Merge pull request #2170 from jvanbaarsen/dont-fail-duplicated-domain

Dont fail when adding a duplicated domain
This commit is contained in:
Michael Hobbs
2016-05-10 14:06:04 -07:00
2 changed files with 7 additions and 7 deletions

View File

@@ -66,15 +66,15 @@ domains_add() {
verify_app_name "$1"
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
if [[ $(egrep -w "^${2}$" "$APP_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
dokku_log_fail "$2 is already defined for $APP"
exit 1
fi
shift 1
for DOMAIN in "$@"; do
echo "$DOMAIN" >> "$APP_VHOST_PATH"
dokku_log_info1 "Added $DOMAIN to $APP"
if [[ $(egrep -w "^$DOMAIN$" "$APP_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
dokku_log_info1 "Skipping: $DOMAIN already added to $APP"
else
echo "$DOMAIN" >> "$APP_VHOST_PATH"
dokku_log_info1 "Added $DOMAIN to $APP"
fi
done
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]];then

View File

@@ -49,7 +49,7 @@ teardown() {
run dokku domains:add $TEST_APP test.app.dokku.me
echo "output: "$output
echo "status: "$status
assert_failure
assert_success
}
@test "(domains) domains:remove" {