Skip to content

Commit

Permalink
only send pkg src if not contained in the other paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke committed Sep 14, 2017
1 parent 1f2ae71 commit ac6904d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion create_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pkg_dir=$(get_pkg_dir $pkg)

configure_main "$session" "$(get_pkg_name $pkg_dir)"

send_src "$pkg_dir" "$session"
send_src_unique "$pkg_dir" "$session" "$@"

for p in "$@"
do
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pkg_dir=$(get_pkg_dir $pkg)

configure_pkg_launch "$session" "$pkg_dir" "$launch"

send_src "$pkg_dir" "$session"
send_src_unique "$pkg_dir" "$session" "$@"

for p in "$@"
do
Expand Down
25 changes: 25 additions & 0 deletions helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,28 @@ function send_src {
tar_src $1 > "$t"
upload "$2/src" "$t" && rm $t || { rm $t; error "could not upload"; }
}

function test_unique_dir {
local test_dir
local other_dir
test_dir=$(cd "$1"; pwd -P)
shift
for p in "$@"
do
other_dir=$(cd "$p"; pwd -P)
if [[ "$test_dir" == "$other_dir"* ]]; then
return 1
fi
done
return 0
}

function send_src_unique {
local path=$1
local session=$2
shift 2
if test_unique_dir "$path" "$@"; then
send_src "$path" "$session"
fi
return 0
}

0 comments on commit ac6904d

Please sign in to comment.