client: lib_docker: add edit option for custom Dockerfile

This commit is contained in:
2024-06-26 01:26:00 -07:00
parent 494e0c5402
commit 8eab0eb560
2 changed files with 13 additions and 5 deletions

View File

@@ -233,7 +233,7 @@ function lib_docker::__edit()
Configuration type:
type${global_arg_delim_2}<env|{shell|superscript}>
type${global_arg_delim_2}<env|{shell|superscript}|{build|dockerfile}>
\e[32mExamples:\e[0m
@@ -243,8 +243,11 @@ function lib_docker::__edit()
\e[37;2m# Edit client/container shell (superscript) \e[0m
$ $global_usage type${global_arg_delim_2}shell
\e[37;2m# Edit client/container shell (w/ alternate wording) and environment variables\e[0m
$ $global_usage type${global_arg_delim_2}superscript${global_arg_delim_3}env
\e[37;2m# Edit client's custom Dockerfile (appended to final Dockerfile) \e[0m
$ $global_usage type${global_arg_delim_2}build
\e[37;2m# Previous commands with alternate wordings\e[0m
$ $global_usage type${global_arg_delim_2}superscript${global_arg_delim_3}dockerfile${global_arg_delim_3}env
"
if [ $# -ne 1 ]; then
@@ -277,7 +280,7 @@ function lib_docker::__edit()
read -ra _read <<<"$_arg_type"
for _type in "${_read[@]}"; do
if [[ ! "$_type" =~ ^env$|^shell$|^superscript$ ]]; then
if [[ ! "$_type" =~ ^env$|^shell$|^superscript$|^build$|^dockerfile$ ]]; then
lib_utils::die_usage "$_usage"
fi
done
@@ -312,6 +315,11 @@ function lib_docker::__edit()
_paths+=("$global_shell_file")
;;
build | dockerfile)
[ -z "$global_custom_dockerfile" ] && lib_utils::die_fatal
_paths+=("$global_custom_dockerfile")
;;
esac
done