From 2522d07a5f8b1078375b94bfe3baa9443541f94c Mon Sep 17 00:00:00 2001 From: BSKY Date: Sat, 21 Mar 2020 10:57:58 +0900 Subject: [PATCH] Fix shellcheck errors --- __tests__/create-cache-files.sh | 2 +- __tests__/verify-cache-files.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/create-cache-files.sh b/__tests__/create-cache-files.sh index 885a5f2..d09b178 100755 --- a/__tests__/create-cache-files.sh +++ b/__tests__/create-cache-files.sh @@ -8,4 +8,4 @@ if [ -z "$prefix" ]; then fi mkdir test-cache -echo "$prefix $GITHUB_RUN_ID" > test-cache/test-file.txt \ No newline at end of file +echo "$prefix $GITHUB_RUN_ID" >test-cache/test-file.txt diff --git a/__tests__/verify-cache-files.sh b/__tests__/verify-cache-files.sh index c7b75ae..42b993d 100755 --- a/__tests__/verify-cache-files.sh +++ b/__tests__/verify-cache-files.sh @@ -23,8 +23,8 @@ fi # Verify file content content="$(cat $file)" -echo "File content:\n$content" -if [ -z "$(echo $content | grep --fixed-strings "$prefix $GITHUB_RUN_ID")" ]; then +printf "File content:\n%s\n" "$content" +if ! echo "$content" | grep --fixed-strings "$prefix $GITHUB_RUN_ID"; then echo "Unexpected file content" exit 1 -fi \ No newline at end of file +fi