From 10003d073c16c18da669b66f235c0e9abc1230f1 Mon Sep 17 00:00:00 2001 From: Boxuan Li Date: Wed, 1 Aug 2018 23:59:23 +0800 Subject: [PATCH] netlify.toml: Verify pre-fetched files exist Closes https://github.com/coala/gh-board/issues/140 --- netlify.toml | 3 +++ script/run-test.sh | 12 +----------- script/verify-files.sh | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 netlify.toml create mode 100755 script/verify-files.sh diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..263fd6b0 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] + publish = "." + command = "script/build.sh && script/verify-files.sh" diff --git a/script/run-test.sh b/script/run-test.sh index a363e574..e553bde6 100755 --- a/script/run-test.sh +++ b/script/run-test.sh @@ -1,16 +1,6 @@ #!/bin/bash set -e -x -# Verify files exist -files=( "issues.json" "recent-issues.json" ) -for file in "${files[@]}" -do - if [[ -f "$file" ]]; then - echo "File $file exists." - else - echo "File $file does not exist." - exit 1 - fi -done +script/verify-files.sh $(npm bin)/jest diff --git a/script/verify-files.sh b/script/verify-files.sh new file mode 100755 index 00000000..c92f321d --- /dev/null +++ b/script/verify-files.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e -x + +# Verify files exist +files=( "issues.json" "recent-issues.json" ) +for file in "${files[@]}" +do + if [[ -f "$file" ]]; then + echo "File $file exists." + else + echo "File $file does not exist." + exit 1 + fi +done