forked from ImageMagick/ImageMagick
-
Notifications
You must be signed in to change notification settings - Fork 2
/
AppRun
28 lines (23 loc) · 869 Bytes
/
AppRun
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# The purpose of this custom AppRun script is
# to allow symlinking the AppImage and invoking
# the corresponding binary depending on which
# symlink was used to invoke the AppImage
HERE="$(dirname "$(readlink -f "${0}")")"
export MAGICK_HOME="$HERE/usr" # http://www.imagemagick.org/QuickStart.txt
export MAGICK_CONFIGURE_PATH=$(readlink -f "$HERE/usr/lib/ImageMagick-*/config-*/") # Undocumented?
if [ "$1" == "man" ] ; then
export MANPATH="$HERE/usr/share/man:$MANPATH" ; exec "$@" ; exit $?
elif [ "$1" == "info" ] ; then
export INFOPATH="$HERE/usr/share/info:$INFOPATH" ; exec "$@" ; exit $?
fi
if [ ! -z $APPIMAGE ] ; then
BINARY_NAME=$(basename "$ARGV0")
if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
exec "$HERE/usr/bin/$BINARY_NAME" "$@"
else
exec "$HERE/usr/bin/magick" "$@"
fi
else
exec "$HERE/usr/bin/magick" "$@"
fi