Misc
Index¶
misc::this_script_dir¶
Print the directory containing the calling script (resolved at call time via BASH_SOURCE). Useful for computing paths relative to the script's own location, e.g.: path::remove "$(misc::this_script_dir)" Output: stdout — absolute path of the calling script's directory shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites
Function has no arguments.
misc::auto_answer¶
Return true if the SCRIPTS_AUTO_ANSWER env var is set to 'y' or 'Y'. Used to non-interactively accept all prompts in automated runs. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites
Function has no arguments.
misc::exec_gui¶
Launch a GUI app detached from the terminal, except for CLI probe flags.
Replaces the calling shell via exec; the launched process runs in a new session (via
setsid --fork) with stdout and stderr discarded. When any argument is --version or
--help (see args::has_cli_probe_flag) the command runs attached instead, with no
redirection, so its output and exit status reach the caller — those flags never launch
a GUI. Must be the last statement in the calling script — exec does not return. Use this
instead of cmd "$@" > '/dev/null' 2>&1 & + disown (backgrounded commands are banned
because their exit status does not propagate to the parent).
Arguments¶
- $1 (GUI): executable name or path
- ... (remaining): args passed verbatim to the GUI executable