diff --git a/package/common/util.sh b/package/common/util.sh index 6292d15e4e..37c508cca5 100755 --- a/package/common/util.sh +++ b/package/common/util.sh @@ -1,5 +1,21 @@ #!/bin/bash +function set_source_dir () +{ + if [[ -z ${TRAVIS_BUILD_DIR+x} ]]; then + if [[ ! -z ${1+x} ]]; then + SLIC3R_DIR=$1 + echo "Using SLIC3R_DIR = $1" + else + SLIC3R_DIR=$(pwd) + echo "Using current directory as source dir" + fi + else + SLIC3R_DIR="$TRAVIS_BUILD_DIR" + echo "Using Travis build dir" + fi +} + # must be run from the root function set_version () { diff --git a/package/linux/appimage.sh b/package/linux/appimage.sh index 3a68b5e179..285cc0d753 100755 --- a/package/linux/appimage.sh +++ b/package/linux/appimage.sh @@ -9,6 +9,7 @@ source $(dirname $0)/../common/util.sh +set_source_dir $2 set_version get_commit set_build_id diff --git a/package/linux/make_archive.sh b/package/linux/make_archive.sh index 1bbcd9b146..a780ce20db 100755 --- a/package/linux/make_archive.sh +++ b/package/linux/make_archive.sh @@ -17,6 +17,7 @@ source $(dirname $0)/../common/util.sh # Determine if this is a tagged (release) commit. # Change the build id accordingly. +set_source_dir $2 set_version get_commit set_build_id