From 272268544c66d8b10351152875f69e59d20e68a7 Mon Sep 17 00:00:00 2001 From: David Hadka Date: Tue, 7 Apr 2020 23:30:01 -0400 Subject: [PATCH] Add path argument to verify-cache-files.sh --- __tests__/verify-cache-files.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/__tests__/verify-cache-files.sh b/__tests__/verify-cache-files.sh index c7b75ae..3ee8a84 100755 --- a/__tests__/verify-cache-files.sh +++ b/__tests__/verify-cache-files.sh @@ -7,6 +7,12 @@ if [ -z "$prefix" ]; then exit 1 fi +path="$2" +if [ -z "$path" ]; then + echo "Must specify path argument" + exit 1 +fi + # Sanity check GITHUB_RUN_ID defined if [ -z "$GITHUB_RUN_ID" ]; then echo "GITHUB_RUN_ID not defined" @@ -14,7 +20,7 @@ if [ -z "$GITHUB_RUN_ID" ]; then fi # Verify file exists -file="test-cache/test-file.txt" +file="$path/test-file.txt" echo "Checking for $file" if [ ! -e $file ]; then echo "File does not exist" @@ -27,4 +33,4 @@ echo "File content:\n$content" if [ -z "$(echo $content | grep --fixed-strings "$prefix $GITHUB_RUN_ID")" ]; then echo "Unexpected file content" exit 1 -fi \ No newline at end of file +fi