Hack to allow relative paths to be specified on the command line when calling an AppImage

master
Ismael Barros² 2014-11-16 14:45:17 +01:00
parent 563b13a0a8
commit c9f49704df
6 changed files with 43 additions and 5 deletions

View File

@ -9,8 +9,13 @@ LOGFILE=$(mktemp "/tmp/AppRun-log-${APPPKG}.XXXXXXXXXX")
BINARY="java"
BINARY_ARGS="-jar _BINARY_"
. "$APPDIR/util.sh"
# Uncomment this if the app needs relative paths specified on the command line
#eval arguments="$(patch_relative_paths "$@")"
#set -- "${arguments[@]}"
cd "$APPDIR"
. ./util.sh
export PATH="$PWD/jre1.7.0_17/bin:${PATH}"
export LD_LIBRARY_PATH="$PWD/jre1.7.0_17/lib/i386:${LD_LIBRARY_PATH}"

View File

@ -9,8 +9,13 @@ LOGFILE=$(mktemp "/tmp/AppRun-log-${APPPKG}.XXXXXXXXXX")
BINARY="./_BINARY_"
BINARY_ARGS=
. "$APPDIR/util.sh"
# Uncomment this if the app needs relative paths specified on the command line
#eval arguments="$(patch_relative_paths "$@")"
#set -- "${arguments[@]}"
cd "$APPDIR"
. ./util.sh
export PATH="$PWD/usr/bin/:$PATH"

View File

@ -9,8 +9,13 @@ LOGFILE=$(mktemp "/tmp/AppRun-log-${APPPKG}.XXXXXXXXXX")
BINARY="./_BINARY_"
BINARY_ARGS=
. "$APPDIR/util.sh"
# Uncomment this if the app needs relative paths specified on the command line
#eval arguments="$(patch_relative_paths "$@")"
#set -- "${arguments[@]}"
cd "$APPDIR"
. ./util.sh
export PATH="$PWD/usr/bin/:$PATH"

View File

@ -9,8 +9,13 @@ LOGFILE=$(mktemp "/tmp/AppRun-log-${APPPKG}.XXXXXXXXXX")
BINARY="./_BINARY_"
BINARY_ARGS=
. "$APPDIR/util.sh"
# Uncomment this if the app needs relative paths specified on the command line
#eval arguments="$(patch_relative_paths "$@")"
#set -- "${arguments[@]}"
cd "$APPDIR"
. ./util.sh
export PATH="$PWD/usr/bin/:$PATH"

View File

@ -10,8 +10,13 @@ BINARY="_BINARY_"
BINARY_ARGS=
WINETRICKS=
. "$APPDIR/util.sh"
# Uncomment this if the app needs relative paths specified on the command line
#eval arguments="$(patch_relative_paths "$@")"
#set -- "${arguments[@]}"
cd "$APPDIR"
. ./util.sh
export PATH="$PWD/usr/bin/:${PATH}"

View File

@ -155,3 +155,16 @@ show_usage()
[ -f "$usage_file" ] && cat "$usage_file"
}
patch_relative_paths()
{
local output=()
for i in "$@"; do
if [ -f "$i" ]; then
abs="$(readlink -f "$i")"
echo "[AppImage] Converting parameter '$i' into '$abs'" >&2
i="$abs"
fi
output+=("\"$i\"")
done
echo "(${output[@]})"
}