aboutsummaryrefslogtreecommitdiff
path: root/bin/app-init
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-10-27 15:07:31 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-10-27 18:31:38 +0100
commit38d7ffca0b591694c17509d20c8bf55606e60536 (patch)
tree64420db3c4f4f7e93a087b12df3d3cead874b025 /bin/app-init
parentebf5da2c7932f05f23fcb8dccd74023c306a3aa3 (diff)
downloadapp.sh-38d7ffca0b591694c17509d20c8bf55606e60536.tar.gz
app.sh-38d7ffca0b591694c17509d20c8bf55606e60536.tar.bz2
app.sh-38d7ffca0b591694c17509d20c8bf55606e60536.tar.xz
app.sh-38d7ffca0b591694c17509d20c8bf55606e60536.zip
app-ls-apps:
o New command to list all applications installed under a directory. app-foreach-app: o New command to execute another command for each app installed under the current directory. app-init/app-install-file: o Adding -C and -c to prepand and append config files around the appliation's build-in configuration files. app-cat-conf: o Use $APP_HOME as the 'appliation installation directory' if set. app-operator-pid: o Support PID files created by the launcher.
Diffstat (limited to 'bin/app-init')
-rwxr-xr-xbin/app-init30
1 files changed, 27 insertions, 3 deletions
diff --git a/bin/app-init b/bin/app-init
index fb4f7cd..534a876 100755
--- a/bin/app-init
+++ b/bin/app-init
@@ -13,7 +13,9 @@ usage_text() {
}
dir=
-while getopts "d:" opt
+prepend_config=
+append_config=
+while getopts "d:C:c:" opt
do
case $opt in
d)
@@ -21,6 +23,24 @@ do
shift 2
OPTIND=1
;;
+ C)
+ prepend_config=$OPTARG
+ if [[ ! prepend_config =~ ^/ ]]
+ then
+ prepend_config="`pwd`/$prepend_config"
+ fi
+ shift 2
+ OPTIND=1
+ ;;
+ c)
+ append_config=$OPTARG
+ if [[ ! append_config =~ ^/ ]]
+ then
+ append_config="`pwd`/$append_config"
+ fi
+ shift 2
+ OPTIND=1
+ ;;
esac
done
@@ -52,7 +72,7 @@ fi
mkdir -p -- "$dir" "$dir/.app"
ok=no
-clean_dir=`cd "$dir">/dev/null; pwd`
+clean_dir=`cd "$dir" && pwd`
trap '[[ $ok == yes ]] || rm -rf "$clean_dir"' EXIT
cd "$dir"
@@ -74,6 +94,10 @@ echo "Resolved version to $resolved_version"
"$resolver" download-version -v "$resolved_version" -f .app/latest.zip
-app-install-file -v "$resolved_version" -f .app/latest.zip
+app-install-file \
+ -v "$resolved_version" \
+ ${prepend_config:+-C "$prepend_config"} \
+ ${append_config:+-c "$append_config"} \
+ -f .app/latest.zip
ok=yes