File tree Expand file tree Collapse file tree
data/scripts/Linux-AppImage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ bold=$(tput bold || true)
1212red=$( tput setaf 1 || true)
1313reset=$( tput sgr0 || true)
1414
15- DIR=$( dirname " $0 " )
15+ DIR=$( dirname " $( realpath " $0 " ) " )
1616readonly AI_LIB_PATH=" $DIR " /usr/lib
1717n_ld_library_path=" $AI_LIB_PATH " ${LD_LIBRARY_PATH: +" :$LD_LIBRARY_PATH " }
1818LD_PRELOAD=${LD_PRELOAD-}
@@ -33,6 +33,21 @@ get_tools() {(
3333 find " $DIR /usr/bin" -mindepth 1 -exec basename {} \; | tr ' \n' ' '
3434)}
3535
36+ # handle symlinks, so eg. if symlinked to hd-rum-transcode, ruh the transcoder
37+ # (no need to use `U.traGrid...AppImage -o hd-rum-transcode`)
38+ get_tool_from_progname () {(
39+ prog=$( basename " ${ARGV0?} " )
40+ # shellcheck disable=SC2046 # intentional
41+ set -- $( get_tools)
42+ while [ $# -gt 0 ]; do
43+ if [ " $prog " = " $1 " ]; then
44+ echo " $1 "
45+ return
46+ fi
47+ shift
48+ done
49+ )}
50+
3651usage () {
3752 printf " usage:\n"
3853 printf " \t${bold}${red} %s${reset} ${bold} [--gui [args]]${reset} \n" " $ARGV0 "
@@ -393,6 +408,11 @@ if [ "${APPIMAGE_DEBUG-undef}" = undef ] && [ "${ULTRAGRID_VERBOSE-}" ]; then
393408 APPIMAGE_DEBUG=$ULTRAGRID_VERBOSE
394409fi
395410
411+ tool=$( get_tool_from_progname)
412+ if [ " $tool " ]; then
413+ set -- -o " $tool " " $@ "
414+ fi
415+
396416if [ $# -eq 0 ] || [ " ${1-} " = " --gui" ]; then
397417 handle_autoupdates " $@ "
398418 if [ $# -eq 0 ]; then usage; else shift ; fi
You can’t perform that action at this time.
0 commit comments