aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-04-21 11:10:37 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2013-04-21 14:58:23 +0200
commit079a49eaaa5a6bacca3181671abd8ebb72015fd1 (patch)
treefd956e35d17bf41f173d02613c0c31a350291d89 /lib
parentc8a9de50c8f7254c61888982ae270bf71c3f8506 (diff)
downloadapp.sh-079a49eaaa5a6bacca3181671abd8ebb72015fd1.tar.gz
app.sh-079a49eaaa5a6bacca3181671abd8ebb72015fd1.tar.bz2
app.sh-079a49eaaa5a6bacca3181671abd8ebb72015fd1.tar.xz
app.sh-079a49eaaa5a6bacca3181671abd8ebb72015fd1.zip
o Allowing the 'app' wrapper to run apps from libexec too.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/common9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/common b/lib/common
index 83ee746..d2d29c8 100755
--- a/lib/common
+++ b/lib/common
@@ -1,5 +1,7 @@
#!/bin/bash
+# Asserts that the cwd is an app directory.
+# By default it checks that there is a 'current' link.
assert_is_app() {
local check_link=yes
local version=
@@ -51,6 +53,8 @@ show_help() {
if [ "`declare -f usage_text >/dev/null; echo $?`" = 0 ]
then
usage_text
+ else
+ echo "The command $usage_app does not have any usage info."
fi
exit 1
}
@@ -205,14 +209,15 @@ run_app() {
cd "versions/$version"
fi
+ path=/bin:/usr/bin
+
# This magically get the expansion of $u correct.
IFS="
"
- # Set a default PATH which can be overridden by the application's settings
set +e
env -i \
- PATH=/bin:/usr/bin \
+ PATH="$PATH" \
$e \
PWD="$PWD" \
APPSH_HOME="$APPSH_HOME" \