#4635 Move source dir determinator into common utilties.

This commit is contained in:
Joseph Lenox 2018-12-30 12:45:42 -06:00 committed by Joseph Lenox
parent 63c7d68140
commit ed45c01420
3 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/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 # must be run from the root
function set_version () function set_version ()
{ {

View File

@ -9,6 +9,7 @@
source $(dirname $0)/../common/util.sh source $(dirname $0)/../common/util.sh
set_source_dir $2
set_version set_version
get_commit get_commit
set_build_id set_build_id

View File

@ -17,6 +17,7 @@ source $(dirname $0)/../common/util.sh
# Determine if this is a tagged (release) commit. # Determine if this is a tagged (release) commit.
# Change the build id accordingly. # Change the build id accordingly.
set_source_dir $2
set_version set_version
get_commit get_commit
set_build_id set_build_id