Compare commits
1 Commits
v0.2.24
...
8ba7242861
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ba7242861 |
@@ -481,6 +481,13 @@ write_index() {
|
|||||||
local issues_json="$3"
|
local issues_json="$3"
|
||||||
local temp_file="$INDEX_FILE.tmp.$$"
|
local temp_file="$INDEX_FILE.tmp.$$"
|
||||||
printf '{"base": %s, "pm_agent": %s, "issues": %s}\n' "$base" "$pm_agent" "$issues_json" > "$temp_file"
|
printf '{"base": %s, "pm_agent": %s, "issues": %s}\n' "$base" "$pm_agent" "$issues_json" > "$temp_file"
|
||||||
|
|
||||||
|
if ! python3 -c "import json; json.load(open('$temp_file'))" 2>/dev/null; then
|
||||||
|
echo "Error: write_index would create malformed JSON, aborting. base=$base, pm_agent=$pm_agent, issues_json=$issues_json" >&2
|
||||||
|
rm -f "$temp_file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
mv "$temp_file" "$INDEX_FILE"
|
mv "$temp_file" "$INDEX_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ write_index() {
|
|||||||
local issues_json="$3"
|
local issues_json="$3"
|
||||||
local temp_file="$INDEX_FILE.tmp.$$"
|
local temp_file="$INDEX_FILE.tmp.$$"
|
||||||
printf '{"base": %s, "pm_agent": %s, "issues": %s}\n' "$base" "$pm_agent" "$issues_json" > "$temp_file"
|
printf '{"base": %s, "pm_agent": %s, "issues": %s}\n' "$base" "$pm_agent" "$issues_json" > "$temp_file"
|
||||||
|
|
||||||
|
if ! python3 -c "import json; json.load(open('$temp_file'))" 2>/dev/null; then
|
||||||
|
echo "Error: write_index would create malformed JSON, aborting. base=$base, pm_agent=$pm_agent, issues_json=$issues_json" >&2
|
||||||
|
rm -f "$temp_file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
mv "$temp_file" "$INDEX_FILE"
|
mv "$temp_file" "$INDEX_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user