Hide yes from the playground command list

`yes` ships in the WASM binary but its infinite output just spams the
terminal, so filter it out of the generated WASM_COMMANDS list. Done
in the workflow so a single regex covers both autocomplete/help (via
AVAILABLE_COMMANDS) and the rendered prose section.
This commit is contained in:
Sylvestre Ledru
2026-05-13 08:45:22 +02:00
parent 27435ba3dc
commit c8e78040fe
+5 -1
View File
@@ -140,9 +140,13 @@ jobs:
echo "Available locales: $locales" echo "Available locales: $locales"
# Generate the list of available commands from the feat_wasm feature # Generate the list of available commands from the feat_wasm feature
# in Cargo.toml so the playground stays in sync with the WASM build. # in Cargo.toml so the playground stays in sync with the WASM build.
# HIDDEN_CMDS: utilities that ship in the binary but we don't want to
# advertise in the playground (e.g. `yes` produces infinite output
# that just spams the terminal).
HIDDEN_CMDS='^(yes)$'
commands=$(sed -n '/^feat_wasm = \[/,/^\]/p' Cargo.toml \ commands=$(sed -n '/^feat_wasm = \[/,/^\]/p' Cargo.toml \
| grep -oE '"[a-zA-Z0-9_]+"' | tr -d '"' \ | grep -oE '"[a-zA-Z0-9_]+"' | tr -d '"' \
| sort -u | paste -sd, -) | sort -u | grep -vE "$HIDDEN_CMDS" | paste -sd, -)
echo "const WASM_COMMANDS = [$(echo "$commands" | sed 's/[^,]*/\"&\"/g')];" \ echo "const WASM_COMMANDS = [$(echo "$commands" | sed 's/[^,]*/\"&\"/g')];" \
> ../uutils.github.io/static/wasm/commands.js > ../uutils.github.io/static/wasm/commands.js
echo "Available commands: $commands" echo "Available commands: $commands"