AutoYADM commit: 2025-06-20 16:55:15

This commit is contained in:
Daniel Fichtinger 2025-06-20 16:55:15 -04:00
parent 7737b9e8fd
commit b1fd519278

View file

@ -16,7 +16,12 @@ define-command -docstring %{
fi
}
}
define-command -params 1.. shell-async-command %{
define-command -docstring %{
shell-async-command [switches] <args>: Run the given shell command
asynchronously. Display its output in an info modal.
Switches:
-d echo stdout to *debug* buffer as well
} -params 1.. shell-async-command %{
nop %sh{
{
if [ "$1" = "-d" ]; then
@ -25,7 +30,7 @@ define-command -params 1.. shell-async-command %{
fi
stdout="$(eval "$@")"
cmd="$(printf 'info -title sh "%s"\n' "$stdout")"
if [ "$debug" = "true "]; then
if [ "$debug" = "true" ]; then
dcmd="$(printf 'echo -debug "%s"\n' "$stdout")"
cmd="$(printf '%s\n%s' "$cmd" "$dcmd")"
fi