aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-10-27 23:30:49 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-10-27 23:30:49 +0100
commite694d9024cddf4dd54efd828927e3fd5e70b6c3a (patch)
treedcefc5f39fc837736b9822b7446d2b6eb4e6f802 /libexec
parent38d7ffca0b591694c17509d20c8bf55606e60536 (diff)
downloadapp.sh-e694d9024cddf4dd54efd828927e3fd5e70b6c3a.tar.gz
app.sh-e694d9024cddf4dd54efd828927e3fd5e70b6c3a.tar.bz2
app.sh-e694d9024cddf4dd54efd828927e3fd5e70b6c3a.tar.xz
app.sh-e694d9024cddf4dd54efd828927e3fd5e70b6c3a.zip
o Removing all old code (X files).
o Making sure APPSH_HOME is 1) exported and, 2) always prepended to $PATH. o More documentation on what a zip file actually looks like and how to create hooks.
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/app-cat-conf4
-rwxr-xr-xlibexec/app-grep-path2
-rwxr-xr-xlibexec/app-install-file2
-rwxr-xr-xlibexec/app-operate2
-rwxr-xr-xlibexec/app-operator-pid9
-rwxr-xr-xlibexec/app-resolver-file9
-rwxr-xr-xlibexec/app-resolver-maven2
-rwxr-xr-xlibexec/app-run-hook2
-rwxr-xr-xlibexec/app-set-version2
9 files changed, 18 insertions, 16 deletions
diff --git a/libexec/app-cat-conf b/libexec/app-cat-conf
index 6e2567f..12d3afc 100755
--- a/libexec/app-cat-conf
+++ b/libexec/app-cat-conf
@@ -3,13 +3,11 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
-key_expr="[a-zA-Z][_a-zA-Z0-9]*"
-
files=()
arg_files=()
declare -a arg_files
diff --git a/libexec/app-grep-path b/libexec/app-grep-path
index fa6e5e5..bef44cd 100755
--- a/libexec/app-grep-path
+++ b/libexec/app-grep-path
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
diff --git a/libexec/app-install-file b/libexec/app-install-file
index db9432b..be445d9 100755
--- a/libexec/app-install-file
+++ b/libexec/app-install-file
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
diff --git a/libexec/app-operate b/libexec/app-operate
index 5fa939d..27727c8 100755
--- a/libexec/app-operate
+++ b/libexec/app-operate
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
diff --git a/libexec/app-operator-pid b/libexec/app-operator-pid
index 71871de..a3781ee 100755
--- a/libexec/app-operator-pid
+++ b/libexec/app-operator-pid
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
@@ -80,8 +80,6 @@ find_pid_management() {
command_start() {
launcher=`find_launcher`
- set -x
- echo pwd=`pwd`
pid_management=`find_pid_management`
debug "launcher=$launcher"
@@ -95,9 +93,10 @@ command_start() {
;;
esac
+ export APPSH_HOME
echo "Starting app..."
$launcher <&- 1>&- 2>&- &
-
+
PID=$!
case "$pid_management" in
@@ -205,7 +204,7 @@ then
fatal "\$APP_HOME has to be set."
fi
-pid_file=$APP_HOME/.app/pid
+pid_file=$APP_HOME/.app/pid
PID=
if [ -r $pid_file ]
diff --git a/libexec/app-resolver-file b/libexec/app-resolver-file
index 5aedf88..2b708e8 100755
--- a/libexec/app-resolver-file
+++ b/libexec/app-resolver-file
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
@@ -31,7 +31,12 @@ init() {
local file=${1-}
- if [[ ! -r "$file" ]]
+ if [[ ! $file =~ ^/ ]]
+ then
+ fatal "The file's path must be absolute."
+ fi
+
+ if [[ ! -r $file ]]
then
fatal "Can't read file: $file"
fi
diff --git a/libexec/app-resolver-maven b/libexec/app-resolver-maven
index 25f7242..419adcc 100755
--- a/libexec/app-resolver-maven
+++ b/libexec/app-resolver-maven
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
diff --git a/libexec/app-run-hook b/libexec/app-run-hook
index 9322fe4..a68ff84 100755
--- a/libexec/app-run-hook
+++ b/libexec/app-run-hook
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END
diff --git a/libexec/app-set-version b/libexec/app-set-version
index 1b7fd16..f8ba31f 100755
--- a/libexec/app-set-version
+++ b/libexec/app-set-version
@@ -3,7 +3,7 @@
set -e
set -u
-APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
+export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
. $APPSH_HOME/lib/common
# HEADER END