git pull after parsing options
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 15 Oct 2015 09:20:54 +0000 (11:20 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 15 Oct 2015 09:20:54 +0000 (11:20 +0200)
scripts/create-vm.sh

index f509c0d..c948771 100755 (executable)
@@ -5,11 +5,6 @@ DIRNAME=$(dirname $0)
 
 BUILD="${HOME}/git-build"
 
 
 BUILD="${HOME}/git-build"
 
-echo "Updating $BUILD"
-cd $BUILD
-git pull
-cd -
-
 LOGS=$HOME/machines
 
 [ -d $LOGS ] || { echo "Creating logs dir $LOGS" ; mkdir -p $LOGS; } 
 LOGS=$HOME/machines
 
 [ -d $LOGS ] || { echo "Creating logs dir $LOGS" ; mkdir -p $LOGS; } 
@@ -62,6 +57,11 @@ container="$1" ; shift
 [ -d "$BUILD" ] || usage "Could not find directory $BUILD"
 [ -d /vservers/$container ] && usage "container $container already exists in /vservers"
 
 [ -d "$BUILD" ] || usage "Could not find directory $BUILD"
 [ -d /vservers/$container ] && usage "container $container already exists in /vservers"
 
+echo "Updating $BUILD"
+cd $BUILD
+git pull
+cd -
+
 # compute all vars from args
 [ -z "$DISTRO" ] && DISTRO="$DEFAULT_DISTRO"
 [ -z "$MEMORY" ] && MEMORY="$DEFAULT_MEMORY"
 # compute all vars from args
 [ -z "$DISTRO" ] && DISTRO="$DEFAULT_DISTRO"
 [ -z "$MEMORY" ] && MEMORY="$DEFAULT_MEMORY"