AutoYADM commit: 2025-06-20 16:55:15
This commit is contained in:
parent
7737b9e8fd
commit
b1fd519278
1 changed files with 7 additions and 2 deletions
|
@ -16,7 +16,12 @@ define-command -docstring %{
|
||||||
fi
|
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{
|
nop %sh{
|
||||||
{
|
{
|
||||||
if [ "$1" = "-d" ]; then
|
if [ "$1" = "-d" ]; then
|
||||||
|
@ -25,7 +30,7 @@ define-command -params 1.. shell-async-command %{
|
||||||
fi
|
fi
|
||||||
stdout="$(eval "$@")"
|
stdout="$(eval "$@")"
|
||||||
cmd="$(printf 'info -title sh "%s"\n' "$stdout")"
|
cmd="$(printf 'info -title sh "%s"\n' "$stdout")"
|
||||||
if [ "$debug" = "true "]; then
|
if [ "$debug" = "true" ]; then
|
||||||
dcmd="$(printf 'echo -debug "%s"\n' "$stdout")"
|
dcmd="$(printf 'echo -debug "%s"\n' "$stdout")"
|
||||||
cmd="$(printf '%s\n%s' "$cmd" "$dcmd")"
|
cmd="$(printf '%s\n%s' "$cmd" "$dcmd")"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue