diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-10-17 22:20:46 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-10-17 22:20:46 +0200 |
commit | 993c9a7807e38b365f48334fff6640e07647af03 (patch) | |
tree | 4347844f2039b29f134e4f729ce38180ad047f8c /.app/lib/app-instance | |
parent | fbc6c0b93a88ac10730dd6f4492750cd32e2b44a (diff) | |
download | app.sh-993c9a7807e38b365f48334fff6640e07647af03.tar.gz app.sh-993c9a7807e38b365f48334fff6640e07647af03.tar.bz2 app.sh-993c9a7807e38b365f48334fff6640e07647af03.tar.xz app.sh-993c9a7807e38b365f48334fff6640e07647af03.zip |
o Renaming BASEDIR to apps, APPSH_BASEDIR to APPSH_APPS.
Diffstat (limited to '.app/lib/app-instance')
-rw-r--r-- | .app/lib/app-instance | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/.app/lib/app-instance b/.app/lib/app-instance index 5c452d2..89102b5 100644 --- a/.app/lib/app-instance +++ b/.app/lib/app-instance @@ -32,7 +32,7 @@ resolve_snapshot() { local zip_file=$1 echo "Resolving version $version..." - metadata=$BASEDIR/.app/var/download/$groupId-$artifactId-$version-metadata.xml + metadata=$apps/.app/var/download/$groupId-$artifactId-$version-metadata.xml base_url=$repo/$(echo $groupId | sed "s,\.,/,g")/$artifactId/$version get $base_url/maven-metadata.xml $metadata resolved_version=`xmlstarlet sel -t -m '//snapshotVersion[extension[text()="zip"]]' -v value $metadata` @@ -147,7 +147,7 @@ method_install() { resolve_snapshot - zip_file=$BASEDIR/.app/var/download/$groupId-$artifactId-$resolved_version.zip + zip_file=$apps/.app/var/download/$groupId-$artifactId-$resolved_version.zip download_artifact $zip_file ;; @@ -191,7 +191,7 @@ method_install() { echo "Unpacking..." unzip -q -d $name/$instance/versions/$resolved_version $zip_file - if [ ! -d $BASEDIR/$name/$instance/versions/$resolved_version/root ] + if [ ! -d $apps/$name/$instance/versions/$resolved_version/root ] then echo "Invalid zip file, did not contain a ./root directory." >&2 exit 1 @@ -210,7 +210,7 @@ method_install() { set +e env -i \ PATH=/bin:/usr/bin \ - APPSH_BASEDIR=$BASEDIR \ + APPSH_APPS=$apps \ APPSH_HOME=$APPSH_HOME \ APPSH_NAME=$name \ APPSH_INSTANCE=$instance \ @@ -228,8 +228,8 @@ method_install() { ) echo "Changing current symlink" - rm -f $BASEDIR/$name/$instance/current - ln -s versions/$resolved_version/root $BASEDIR/$name/$instance/current + rm -f $apps/$name/$instance/current + ln -s versions/$resolved_version/root $apps/$name/$instance/current if [ -d $name/$instance/current/bin ] then @@ -239,12 +239,12 @@ method_install() { ) fi - if [ -r $BASEDIR/.app/var/list ] + if [ -r $apps/.app/var/list ] then - sed "/^$name:$instance/d" $BASEDIR/.app/var/list > $BASEDIR/.app/var/list.new + sed "/^$name:$instance/d" $apps/.app/var/list > $apps/.app/var/list.new fi - echo "$name:$instance:$version:$url" >> $BASEDIR/.app/var/list.new - mv $BASEDIR/.app/var/list.new $BASEDIR/.app/var/list + echo "$name:$instance:$version:$url" >> $apps/.app/var/list.new + mv $apps/.app/var/list.new $apps/.app/var/list } method_set_current_usage() { @@ -293,14 +293,14 @@ method_set_current() { assert_is_instance method_set_current_usage "$name" "$instance" "no" - if [ ! -d $BASEDIR/$name/$instance/versions/$version ] + if [ ! -d $apps/$name/$instance/versions/$version ] then echo "Invalid version: $version." exit 1 fi - rm -f $BASEDIR/$name/$instance/current - ln -s versions/$version/root $BASEDIR/$name/$instance/current + rm -f $apps/$name/$instance/current + ln -s versions/$version/root $apps/$name/$instance/current return 0 } @@ -347,7 +347,7 @@ method_list() { esac done - if [ ! -r $BASEDIR/.app/var/list ] + if [ ! -r $apps/.app/var/list ] then return fi |