blob: 36c09eac9d4f9c0975f0d282ce1caa6038efbedf [file] [log] [blame]
probonopd4b458302017-11-09 19:32:56 +01001#!/bin/bash
2
3# The purpose of this custom AppRun script is
4# to allow symlinking the AppImage and invoking
5# the corresponding binary depending on which
6# symlink was used to invoke the AppImage
7
8HERE="$(dirname "$(readlink -f "${0}")")"
9
10export MAGICK_HOME="$HERE/usr" # http://www.imagemagick.org/QuickStart.txt
11export MAGICK_CONFIGURE_PATH="$HERE/usr/lib/ImageMagick-7.0.7/config-Q16/" # Undocumented?
12export MANPATH="$HERE/usr/share/man:$MANPATH"
13export INFOPATH="$HERE/usr/share/info:$MANPATH"
14
15if [ "$1" == "man" ] ; then
16 shift ; exec "$@" ; exit $?
17elif [ "$1" == "info" ] ; then
18 shift ; exec "$@" ; exit $?
19fi
20
21if [ ! -z $APPIMAGE ] ; then
22 BINARY_NAME=$(basename "$ARGV0")
23 if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
24 exec "$HERE/usr/bin/$BINARY_NAME" "$@"
25 else
26 exec "$HERE/usr/bin/magick" "$@"
27 fi
28else
29 exec "$HERE/usr/bin/magick" "$@"
30fi