handle config with spaces over ssh

This commit is contained in:
Michael Hobbs
2014-12-18 11:02:28 -08:00
parent c697c65508
commit 67b7fa6263
2 changed files with 10 additions and 5 deletions

9
dokku
View File

@@ -21,8 +21,13 @@ fi
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
export -n SSH_ORIGINAL_COMMAND
$0 $SSH_ORIGINAL_COMMAND
exit $?
if [[ $1 =~ config-* ]];then
xargs $0 <<<$SSH_ORIGINAL_COMMAND
exit $?
else
$0 $SSH_ORIGINAL_COMMAND
exit $?
fi
fi
case "$1" in

View File

@@ -11,14 +11,14 @@ teardown() {
}
@test "config:set" {
run dokku config:set $TEST_APP test_var=true test_var2='hello world'
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "config:get" {
run dokku config:set $TEST_APP test_var=true test_var2='hello world'
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
echo "output: "$output
echo "status: "$status
run dokku config:get $TEST_APP test_var2
@@ -28,7 +28,7 @@ teardown() {
}
@test "config:unset" {
run dokku config:set $TEST_APP test_var=true test_var2='hello world'
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
echo "output: "$output
echo "status: "$status
run dokku config:get $TEST_APP test_var