Adding possibility to run build script from any folder. 80/6280/1
authorMauro Sardara <[email protected]>
Wed, 19 Apr 2017 16:03:20 +0000 (18:03 +0200)
committerMauro Sardara <[email protected]>
Wed, 19 Apr 2017 16:03:20 +0000 (18:03 +0200)
Change-Id: I29e3a3de47def4a19d5656ee17efeb784984b7f0
Signed-off-by: Mauro Sardara <[email protected]>
scripts/build-package.sh

index 25fa73c..700b5dc 100644 (file)
@@ -3,6 +3,7 @@
 set -euxo pipefail
 IFS=$'\n\t'
 
+SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
 APT_PATH=`which apt-get` || true
 apt_get=${APT_PATH:-"/usr/local/bin/apt-get"}
 
@@ -213,7 +214,7 @@ build() {
 }
 
 # Build libdash
-pushd ../libdash
+pushd $SCRIPT_PATH/../libdash
 build
 make package
 sudo make install
@@ -221,7 +222,7 @@ find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || tru
 popd
 
 # Build viper
-pushd ..
+pushd $SCRIPT_PATH/..
 build
 make package
 find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true