Merge pull request #1018 from progrium/1017_mh-more-robust-arg-parsing
confine arg shifting to between dokku and command. closes #1017
This commit is contained in:
13
dokku
13
dokku
@@ -18,9 +18,16 @@ source "$PLUGIN_PATH/common/functions"
|
|||||||
[[ $DOKKU_TRACE ]] && set -x
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
for arg in "$@"; do
|
args=("$@")
|
||||||
[[ "$arg" =~ ^--.* ]] && shift 1
|
if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||||
done
|
for arg in "$@"; do
|
||||||
|
if [[ "$arg" =~ ^--.* ]];then
|
||||||
|
shift 1
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||||
|
|
||||||
if [[ $(id -un) != "dokku" && $1 != plugins-install* && $1 != "plugins-update" ]]; then
|
if [[ $(id -un) != "dokku" && $1 != plugins-install* && $1 != "plugins-update" ]]; then
|
||||||
|
|||||||
@@ -28,6 +28,14 @@ teardown() {
|
|||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "run (with --options)" {
|
||||||
|
deploy_app
|
||||||
|
run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version"
|
||||||
|
echo "output: "$output
|
||||||
|
echo "status: "$status
|
||||||
|
assert_success
|
||||||
|
}
|
||||||
|
|
||||||
@test "urls (non-ssl)" {
|
@test "urls (non-ssl)" {
|
||||||
run bash -c "dokku urls $TEST_APP | grep dokku.me"
|
run bash -c "dokku urls $TEST_APP | grep dokku.me"
|
||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
|
|||||||
Reference in New Issue
Block a user