forked from EvergreenCrypto/docker-finance
client: src: lib_gen: reduce prompt language verbosity
This commit is contained in:
@@ -410,7 +410,7 @@ function lib_gen::__gen_client()
|
||||
# Backup existing file
|
||||
if [ -f "$global_env_file" ]; then
|
||||
lib_utils::print_custom " \e[32m│\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m├─\e[34;1m Client-side environment found, backup then generate new one? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m├─\e[34;1m Client environment file found, backup then generate new one? [Y/n] \e[0m"
|
||||
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
local _confirm="${_read:-y}"
|
||||
@@ -428,7 +428,7 @@ function lib_gen::__gen_client()
|
||||
fi
|
||||
fi
|
||||
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Edit (new) environment now? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
lib_gen::__gen_edit "$global_env_file"
|
||||
|
||||
# Get/Set new (edited) environment variables
|
||||
@@ -467,7 +467,7 @@ function lib_gen::__gen_client()
|
||||
cp -a "$global_repo_custom_dockerfile" "$global_custom_dockerfile"
|
||||
fi
|
||||
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Edit (new) custom Dockerfile now? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
lib_gen::__gen_edit "$global_custom_dockerfile"
|
||||
fi
|
||||
}
|
||||
@@ -483,7 +483,7 @@ function lib_gen::__gen_container()
|
||||
if [[ -z "${global_arg_type[*]}" || "${global_arg_type[*]}" =~ superscript ]]; then
|
||||
|
||||
lib_utils::print_custom " \e[32m│\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m├─\e[34;1m Generate (or update) joint client/container superscript? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m├─\e[34;1m Generate joint client/container superscript? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
if [[ "$_confirm" == [yY] || -z "$global_arg_confirm" ]]; then
|
||||
@@ -510,7 +510,7 @@ function lib_gen::__gen_container()
|
||||
if [[ "${global_arg_all[*]}" =~ all|type || "${global_arg_type[*]}" =~ flow ]]; then
|
||||
|
||||
lib_utils::print_custom " \e[32m│\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m├─\e[34;1m Generate (or update) container finance flow (layout and profiles)? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m├─\e[34;1m Generate container finance flow (layout and profiles)? [Y/n] \e[0m"
|
||||
# Prompt if type not given
|
||||
if [[ ! "${global_arg_all[*]}" =~ all|type || -z "${global_arg_type[*]}" ]]; then
|
||||
if [ -z "$global_arg_confirm" ]; then
|
||||
@@ -545,7 +545,7 @@ function lib_gen::__gen_superscript()
|
||||
[ -z "$global_superscript" ] && lib_utils::die_fatal
|
||||
|
||||
if [ -f "$global_superscript" ]; then
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Backup existing superscript and generate a new one? [N/y] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Backup existing file and generate a new one? [N/y] \e[0m"
|
||||
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
local _confirm="${_read:-n}"
|
||||
@@ -558,11 +558,11 @@ function lib_gen::__gen_superscript()
|
||||
# Write
|
||||
lib_gen::__gen_superscript_write
|
||||
fi
|
||||
local _print_custom=" \e[32m│ └─\e[34m Edit (new) superscript now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
else
|
||||
# Generate new default file
|
||||
lib_gen::__gen_superscript_write
|
||||
local _print_custom=" \e[32m│ │ └─\e[34m Edit (new) superscript now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
|
||||
lib_utils::print_custom "$_print_custom"
|
||||
@@ -727,7 +727,7 @@ function lib_gen::__gen_subprofile_flow()
|
||||
|
||||
if lib_gen::__gen_subprofile_flow_args_config "subscript"; then
|
||||
lib_utils::print_custom " \e[32m│ │ │\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate (or update) subprofile's subscript file? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate subprofile's subscript file? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
if [[ "$_confirm" == [yY] || -z "$global_arg_confirm" ]]; then
|
||||
@@ -741,7 +741,7 @@ function lib_gen::__gen_subprofile_flow()
|
||||
if lib_gen::__gen_subprofile_flow_args_config "fetch"; then
|
||||
# Prompt for default generation
|
||||
lib_utils::print_custom " \e[32m│ │ │\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate (or update) subprofile's fetch configuration file? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate subprofile's fetch configuration file? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
[[ "$_confirm" == [yY] || -z "$global_arg_confirm" ]] && lib_gen::__gen_subprofile_flow_fetch
|
||||
@@ -749,7 +749,7 @@ function lib_gen::__gen_subprofile_flow()
|
||||
|
||||
if lib_gen::__gen_subprofile_flow_args_config "meta"; then
|
||||
lib_utils::print_custom " \e[32m│ │ │\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate (or update) subprofile's financial metadata file? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate subprofile's financial metadata file? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
[[ "$_confirm" == [yY] || -z "$global_arg_confirm" ]] && lib_gen::__gen_subprofile_flow_meta
|
||||
@@ -757,7 +757,7 @@ function lib_gen::__gen_subprofile_flow()
|
||||
|
||||
if lib_gen::__gen_subprofile_flow_args_config "hledger"; then
|
||||
lib_utils::print_custom " \e[32m│ │ │\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate (or update) subprofile's hledger configuration file? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate subprofile's hledger configuration file? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
[[ "$_confirm" == [yY] || -z "$global_arg_confirm" ]] && lib_gen::__gen_subprofile_flow_hledger
|
||||
@@ -765,7 +765,7 @@ function lib_gen::__gen_subprofile_flow()
|
||||
|
||||
if lib_gen::__gen_subprofile_flow_args_account; then
|
||||
lib_utils::print_custom " \e[32m│ │ │\e[0m\n"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate (or update) subprofile's hledger-flow accounts? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ ├─\e[34;1m Generate subprofile's hledger-flow accounts? [Y/n] \e[0m"
|
||||
if [ ! -z "${global_arg_account[*]}" ]; then
|
||||
lib_utils::print_custom "\n"
|
||||
lib_gen::__gen_subprofile_flow_accounts
|
||||
@@ -818,7 +818,7 @@ function lib_gen::__gen_subprofile_flow_subscript()
|
||||
|
||||
local _file="${_dir}/subscript.bash"
|
||||
if [ -f "$_file" ]; then
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m Subprofile subscript found, backup then generate new one? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m File found, backup then generate new one? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
|
||||
@@ -826,11 +826,11 @@ function lib_gen::__gen_subprofile_flow_subscript()
|
||||
cp -a "$_file" "${_file}_${global_suffix}" || lib_utils::die_fatal
|
||||
|
||||
lib_gen::__gen_subprofile_flow_subscript_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) subprofile subscript now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
else
|
||||
lib_gen::__gen_subprofile_flow_subscript_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) subprofile subscript now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
|
||||
lib_utils::print_custom "$_print_custom"
|
||||
@@ -891,7 +891,7 @@ function lib_gen::__gen_subprofile_flow_fetch()
|
||||
|
||||
local -r _file="${_dir}/fetch.yaml"
|
||||
if [ -f "$_file" ]; then
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m Subprofile's fetch configuration found, backup then generate new one? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m File found, backup then generate new one? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
|
||||
@@ -899,11 +899,11 @@ function lib_gen::__gen_subprofile_flow_fetch()
|
||||
cp -a "$_file" "${_file}_${global_suffix}" || lib_utils::die_fatal
|
||||
|
||||
lib_gen::__gen_subprofile_flow_fetch_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) subprofile's fetch configuration now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
else
|
||||
lib_gen::__gen_subprofile_flow_fetch_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) subprofile's fetch configuration now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
|
||||
lib_utils::print_custom "$_print_custom"
|
||||
@@ -938,7 +938,7 @@ function lib_gen::__gen_subprofile_flow_meta()
|
||||
local _file="${_dir}/meta.csv"
|
||||
if [ -f "$_file" ]; then
|
||||
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m Subprofile's financial metadata found, backup then generate new one? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m File found, backup then generate new one? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
|
||||
@@ -946,11 +946,11 @@ function lib_gen::__gen_subprofile_flow_meta()
|
||||
cp -a "$_file" "${_file}_${global_suffix}" || lib_utils::die_fatal
|
||||
|
||||
lib_gen::__gen_subprofile_flow_meta_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) subprofile's financial metadata now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
else
|
||||
lib_gen::__gen_subprofile_flow_meta_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) subprofile's financial metadata now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
|
||||
lib_utils::print_custom "$_print_custom"
|
||||
@@ -984,7 +984,7 @@ function lib_gen::__gen_subprofile_flow_hledger()
|
||||
|
||||
local _file="${_dir}/hledger.conf"
|
||||
if [ -f "$_file" ]; then
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m hledger configuration found, backup then generate new one? [Y/n] \e[0m"
|
||||
lib_utils::print_custom " \e[32m│ │ │ └─\e[34m File found, backup then generate new one? [Y/n] \e[0m"
|
||||
[ -z "$global_arg_confirm" ] && lib_utils::print_custom "\n" || read -p "" _read
|
||||
_confirm="${_read:-y}"
|
||||
|
||||
@@ -992,11 +992,11 @@ function lib_gen::__gen_subprofile_flow_hledger()
|
||||
cp -a "$_file" "${_file}_${global_suffix}" || lib_utils::die_fatal
|
||||
|
||||
lib_gen::__gen_subprofile_flow_hledger_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) hledger configuration now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
else
|
||||
lib_gen::__gen_subprofile_flow_hledger_write
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit (new) hledger configuration now? [Y/n] \e[0m"
|
||||
local _print_custom=" \e[32m│ │ │ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
fi
|
||||
|
||||
lib_utils::print_custom "$_print_custom"
|
||||
|
||||
Reference in New Issue
Block a user