aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-10-14 08:55:36 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-10-14 08:55:36 +0200
commite9a22d5165c2dda5a0e10506977081222549a8eb (patch)
tree995e471a537719ecd950dfdccb8043836ab406ce /app
parenta7a62352c46b5d2b37baaa09f8145b1171ca79fb (diff)
downloadapp.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.tar.gz
app.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.tar.bz2
app.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.tar.xz
app.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.zip
o Making sure ./app can be symlinked to an installation.
o More tests.
Diffstat (limited to 'app')
-rwxr-xr-xapp22
1 files changed, 18 insertions, 4 deletions
diff --git a/app b/app
index dc70ab0..0c4cbd1 100755
--- a/app
+++ b/app
@@ -2,6 +2,20 @@
set -e
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+
+APPSH_HOME=`dirname "$PRG"`
+APPSH_HOME=`cd "$APPSH_HOME" && pwd`
+
if [ -z "$BASEDIR" ]
then
BASEDIR=`dirname $0`
@@ -28,10 +42,10 @@ method_usage() {
echo "Run $0 -h <group> for more help" >&2
}
-. $BASEDIR/.app/lib/app-common
-. $BASEDIR/.app/lib/app-app
-. $BASEDIR/.app/lib/app-conf
-. $BASEDIR/.app/lib/app-operate
+. $APPSH_HOME/.app/lib/app-common
+. $APPSH_HOME/.app/lib/app-app
+. $APPSH_HOME/.app/lib/app-conf
+. $APPSH_HOME/.app/lib/app-operate
main() {
local method