1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-14 16:46:28 +01:00
Files
audacity/linux/AppRun.sh
Sol Fisher Romanoff f395687c9f Change bash scripts to be POSIX-compatible
some Unix-like operating systems, namely Alpine, don't come with bash
preinstalled.
scripts in the lib-src/ directory were left untouched.

Signed-off-by: Sol Fisher Romanoff <sol@solfisher.com>
2021-12-02 10:13:12 +02:00

52 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
# The AppImage runtime sets some special environment variables. We provide
# default values here in case the user tries to run this script outside an
# AppImage where the variables would otherwise be undefined.
if [ ! "${APPIMAGE}" ] || [ ! "${APPDIR}" ]; then
export APPIMAGE="$(readlink -f "${0}")"
export APPDIR="$(dirname "${APPIMAGE}")"
fi
export LD_LIBRARY_PATH="${APPDIR}/lib:${LD_LIBRARY_PATH}"
export AUDACITY_PATH="${AUDACITY_PATH}:${APPDIR}/share/tenacity"
export AUDACITY_MODULES_PATH="${AUDACITY_MODULES_PATH}:${APPDIR}/lib/modules"
help() {
# Normal tenacity help
"${APPDIR}/bin/tenacity" --help
# Special options handled by this script
cat >&2 <<EOF
--readme display README
--license display LICENSE
--man[ual|page] display tenacity(1) manual page
--check-dependencies check library dependency fulfillment (developer tool)
EOF
# Blank line then special options handled by the AppImage runtime
"${APPIMAGE}" --appimage-help
}
# Intercept command line arguments
case "$1" in
-h|--help )
help
;;
--readme )
exec less "${APPDIR}/share/doc/tenacity/README.txt"
;;
--license )
exec less "${APPDIR}/share/doc/tenacity/LICENSE.txt"
;;
--man|--manual|--manpage )
exec man "${APPDIR}/share/man/man1/tenacity.1"
;;
--check-depends|--check-dependencies )
exec bash "${APPDIR}/bin/check_dependencies"
;;
* )
# Other arguments go to tenacity
exec "${APPDIR}/bin/tenacity" "$@"
;;
esac