aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-19 00:02:18 +0200
committerTeddy Wing2018-04-19 00:03:31 +0200
commitca360a1ea65f6e01de2f99a279ecd8d312c412ab (patch)
treed7a5f3b84774f23078f61515a5e15b5f6c7117ea
parent5382bef7e53a06a4b2b7148b099f73382a5bbd09 (diff)
downloadredprine-ca360a1ea65f6e01de2f99a279ecd8d312c412ab.tar.bz2
preflight(): Initialise cache file
If no cache file is present, `new_pull_requests()` should fail. To allow it to continue to function even in the absence of a cache file, initialise the cache file with an empty JSON array.
-rwxr-xr-xredprine4
1 files changed, 4 insertions, 0 deletions
diff --git a/redprine b/redprine
index 3191853..912d825 100755
--- a/redprine
+++ b/redprine
@@ -187,6 +187,10 @@ function exit_with_error () {
function preflight () {
mkdir -p "$REDPRINE_DATA_DIR"
+
+ if [ ! -f "$CACHE_FILE" ]; then
+ echo '[]' > "$CACHE_FILE"
+ fi
}
function argument_error () {