refactor: deprecate the --detach flag in favor of run:detached

This commit is contained in:
Jose Diaz-Gonzalez
2021-07-27 02:11:43 -04:00
parent 618158a0f3
commit 350a84d253
8 changed files with 35 additions and 11 deletions

View File

@@ -433,6 +433,7 @@ parse_args() {
export DOKKU_QUIET_OUTPUT=1
;;
--detach)
dokku_log_warn_quiet "Deprecated: use run:detached instead of using the --detach flag"
export DOKKU_DETACH_CONTAINER=1
;;
--trace)

View File

@@ -28,5 +28,6 @@ fn-help-content() {
declare desc="return help content"
cat <<help_content
run [--env KEY=VALUE] <app> <cmd>, Run a command in a new container using the current application image
run:detached [--env KEY=VALUE] <app> <cmd>, Run a command in a new detached container using the current application image
help_content
}

View File

@@ -60,3 +60,13 @@ cmd-run() {
export DOKKU_RM_CONTAINER=1
fn-run "$@"
}
cmd-run-detached() {
declare desc="run a detached container"
declare cmd="run:detached"
[[ "$1" == "$cmd" ]] && shift 1
export DOKKU_DETACH_CONTAINER=1
export DOKKU_RM_CONTAINER=1
fn-run "$@"
}

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
source "$PLUGIN_AVAILABLE_PATH/run/internal-functions"
[[ $DOKKU_TRACE ]] && set -x
cmd-run-detached "$@"