From ca360a1ea65f6e01de2f99a279ecd8d312c412ab Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 19 Apr 2018 00:02:18 +0200 Subject: 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. --- redprine | 4 ++++ 1 file changed, 4 insertions(+) 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 () { -- cgit v1.2.3