Skip to content

Commit

Permalink
test upload_executable helper should mkdir before uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbellamy committed Jul 20, 2015
1 parent 5baddb8 commit 7b9e598
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ DOCKER_PORT=2375
upload_executable() {
host=$1
file=$2
prefix=${3:-/usr/local/bin/}
suffix=$(basename "$file")
target="$prefix$suffix"
target=${3:-/usr/local/bin/$(basename "$file")}
dir=$(dirname "$target")
run_on $host "[ -e '$dir' ] || sudo mkdir -p '$dir'"
[ -z "$DEBUG" ] || greyly echo "Uploading to $host: $file -> $target" >&2
<"$file" remote $host $SSH $host sh -c "cat | sudo tee $target >/dev/null"
run_on $host "sudo chmod a+x $target"
Expand Down

0 comments on commit 7b9e598

Please sign in to comment.