File tree 2 files changed +26
-0
lines changed 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -18832,6 +18832,19 @@ playground_schema_derive_schema_command() {
18832
18832
fi
18833
18833
fi
18834
18834
18835
+ if jq -e . >/dev/null 2>&1 <<< "$(head -1 "$payload_file")"
18836
+ then
18837
+ log "💫 payload is one json per line, one json record per line will be used"
18838
+ elif jq -e . >/dev/null 2>&1 <<< "$(cat "$payload_file")"
18839
+ then
18840
+ log "💫 payload is single json, it will be used as one record"
18841
+ jq -c . "$payload_file" > $tmp_dir/minified.json
18842
+ cp $tmp_dir/minified.json $payload_file
18843
+ else
18844
+ logerror "❌ payload is not a valid json"
18845
+ exit 1
18846
+ fi
18847
+
18835
18848
LATEST_TAG=$(grep "export TAG" $root_folder/scripts/utils.sh | head -1 | cut -d "=" -f 2 | cut -d " " -f 1)
18836
18849
if [ -z "$LATEST_TAG" ]
18837
18850
then
Original file line number Diff line number Diff line change 38
38
fi
39
39
fi
40
40
41
+ if jq -e . > /dev/null 2>&1 <<< " $(head -1 " $payload_file " )"
42
+ then
43
+ log " 💫 payload is one json per line, one json record per line will be used"
44
+ elif jq -e . > /dev/null 2>&1 <<< " $(cat " $payload_file " )"
45
+ then
46
+ log " 💫 payload is single json, it will be used as one record"
47
+ jq -c . " $payload_file " > $tmp_dir /minified.json
48
+ cp $tmp_dir /minified.json $payload_file
49
+ else
50
+ logerror " ❌ payload is not a valid json"
51
+ exit 1
52
+ fi
53
+
41
54
LATEST_TAG=$( grep " export TAG" $root_folder /scripts/utils.sh | head -1 | cut -d " =" -f 2 | cut -d " " -f 1)
42
55
if [ -z " $LATEST_TAG " ]
43
56
then
You can’t perform that action at this time.
0 commit comments