From 67b7fa6263935e91bec734a12a1ca188f9b0f24d Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Thu, 18 Dec 2014 11:02:28 -0800 Subject: [PATCH] handle config with spaces over ssh --- dokku | 9 +++++++-- tests/unit/config.bats | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dokku b/dokku index a9dfb56f7..3b5822440 100755 --- a/dokku +++ b/dokku @@ -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 diff --git a/tests/unit/config.bats b/tests/unit/config.bats index e5bf65034..389a31069 100644 --- a/tests/unit/config.bats +++ b/tests/unit/config.bats @@ -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