Change ssh_args variable to an array, so it can be quoted properly
@@ -15,7 +15,7 @@ fi
# kick off the mac unstable build
echo "Kicking off the $BINTRAY_REPO mac build"
var_file=/tmp/our-awesome-vars
-ssh_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /tmp/habitat-srv-admin"
+ssh_args=(-o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -i /tmp/habitat-srv-admin)
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
co="FETCH_HEAD"
@@ -27,7 +27,7 @@ fi
# first update the copy of the habitat code stored on the mac server to the latest
# shellcheck disable=2087
-ssh "${ssh_args}" ${mac_builder} << EOF
+ssh "${ssh_args[@]}" ${mac_builder} << EOF
hab_src_dir="\$HOME/code/$TRAVIS_BUILD_NUMBER"
mkdir -p \${hab_src_dir}
cd \${hab_src_dir}
@@ -49,10 +49,10 @@ export BINTRAY_PASSPHRASE=$BINTRAY_PASSPHRASE
export TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
EOF
-scp "${ssh_args}" ${var_file} ${mac_builder}:~/tmp
+scp "${ssh_args[@]}" ${var_file} ${mac_builder}:~/tmp
rm ${var_file}
# kick off the build
# shellcheck disable=2029
-ssh "${ssh_args}" ${mac_builder} \
+ssh "${ssh_args[@]}" ${mac_builder} \
"sudo ~/code/$TRAVIS_BUILD_NUMBER/habitat/support/ci/deploy_mac.sh"
