Refactor enviornment setup script
@@ -23,9 +23,9 @@ platform=$(uname -s)
bitType=$(arch)
BASEDIR=$(dirname "$0")
-
#Extract the compressed archive based on the platform and the bitype
extractCompressArchive() {
+ cd ../../../../../cmd/build
tar -xvzf wso2mi-cli-$VERSION-linux-x64.tar.gz
}
@@ -44,7 +44,8 @@ cd $BASEDIR
DIR="../../../../../cmd/build"
if [ -d "$DIR" ]; then
- echo "CLI build exists. Hence skipping the environment setup phase"
+ echo "CLI build exists. Extracting Compress Archive"
+ extractCompressArchive
else
echo "CLI build does not exists. Setting up the environment..."
#download all the dependencies
@@ -62,16 +63,16 @@ else
cd cmd
./build.sh -t mi.go -v ${VERSION} -f
-
#Extract the compressed archive generated
echo "Extract the CLI archive "
- cd build
extractCompressArchive
+fi
+
#start the application
cd wso2mi-cli-$VERSION/bin
echo "ClI setup Complete"
-fi
+
}
setup
