Added many, many more actions.

This commit is contained in:
2025-06-24 15:24:16 -07:00
parent 62fbe4dead
commit 57ef232d2b
108 changed files with 4212 additions and 7 deletions

16
yq/yq-trim/trim.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
INPUT="$1"
RECURSIVE="$2"
if [[ -f "$INPUT" ]]; then
INPUT=$(cat "$INPUT")
fi
OUTPUT=$(echo "$INPUT" | yq e 'del(.. | select(length == 0))')
if [[ "$RECURSIVE" == "true" ]]; then
while [ "$(echo "$OUTPUT" | yq e 'map (.. | select (length == 0)) | any')" = "true" ]; do
OUTPUT=$(echo "$OUTPUT" | yq e 'del (.. | select (length == 0))')
done
fi
echo "$OUTPUT"