refactor: deprecate the --detach flag in favor of run:detached
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 "$@"
|
||||
}
|
||||
|
||||
6
plugins/run/subcommands/detached
Executable file
6
plugins/run/subcommands/detached
Executable 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 "$@"
|
||||
Reference in New Issue
Block a user