test upload_executable helper should mkdir before uploading
This commit is contained in:
1 parent
5baddb83cb
commit
7b9e59833e
1 file changed
+3
-3
+3
-3
@@ -46,9 +46,9 @@ DOCKER_PORT=2375
|
|||||||
upload_executable() {
|
upload_executable() {
|
||||||
host=$1
|
host=$1
|
||||||
file=$2
|
file=$2
|
||||||
prefix=${3:-/usr/local/bin/}
|
target=${3:-/usr/local/bin/$(basename "$file")}
|
||||||
suffix=$(basename "$file")
|
dir=$(dirname "$target")
|
||||||
target="$prefix$suffix"
|
run_on $host "[ -e '$dir' ] || sudo mkdir -p '$dir'"
|
||||||
[ -z "$DEBUG" ] || greyly echo "Uploading to $host: $file -> $target" >&2
|
[ -z "$DEBUG" ] || greyly echo "Uploading to $host: $file -> $target" >&2
|
||||||
<"$file" remote $host $SSH $host sh -c "cat | sudo tee $target >/dev/null"
|
<"$file" remote $host $SSH $host sh -c "cat | sudo tee $target >/dev/null"
|
||||||
run_on $host "sudo chmod a+x $target"
|
run_on $host "sudo chmod a+x $target"
|
||||||
|
|||||||
Reference in new issue
Block a user