Skip to content

Commit

Permalink
slic3r#4635 Move source dir determinator into common utilties.
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofhyphens committed Dec 31, 2018
1 parent 63c7d68 commit ed45c01
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions package/common/util.sh
Original file line number Diff line number Diff line change
@@ -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 ()
{
Expand Down
1 change: 1 addition & 0 deletions package/linux/appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

source $(dirname $0)/../common/util.sh

set_source_dir $2
set_version
get_commit
set_build_id
Expand Down
1 change: 1 addition & 0 deletions package/linux/make_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed45c01

Please sign in to comment.