chatgpt to the rescue

This commit is contained in:
Matthew Rathbone
2024-04-12 21:28:41 -05:00
parent 57ea6edc95
commit a4c3deb154

View File

@@ -2,7 +2,7 @@
# Use $(...) for command substitution
FILES=$(find apps/studio/tests/integration/lib/db -name "*spec.js")
# Properly handle newline characters and convert to JSON array
JSON=$(echo "$FILES" | jq -R -s 'split("\n")[:-1]')
# Convert to JSON array directly
JSON=$(echo "$FILES" | jq -Rsc 'split("\n") | if last == "" then .[:-1] else . end')
echo "$JSON"