Skip to content

Commit d1c441e

Browse files
committed
Added jq_all_schemas utility
1 parent e5d15d6 commit d1c441e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

utils/jq_all_schemas.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# Applies the provided jq command to all 6 values.schema.json file and update them all in place
4+
5+
# Ensure correct usage
6+
if [ "$#" -ne 1 ]; then
7+
echo "Usage: $0 '<jq_query>'"
8+
exit 1
9+
fi
10+
11+
JQ_QUERY="$1"
12+
TMP_FILE="/tmp/jq_tmp.json"
13+
14+
echo "Applying query '$JQ_QUERY'"
15+
for CHART in vscode-python vscode-pyspark rstudio rstudio-sparkr jupyter-python jupyter-pyspark; do
16+
SCHEMA_FILE="./charts/$CHART/values.schema.json"
17+
echo " Processing $SCHEMA_FILE"
18+
jq "$JQ_QUERY" "$SCHEMA_FILE" > "$TMP_FILE"
19+
mv "$TMP_FILE" "$SCHEMA_FILE"
20+
done

0 commit comments

Comments
 (0)