React to feedback

This commit is contained in:
Aiqiao Yan
2020-05-15 12:18:50 -04:00
parent b3c8e19a7a
commit d2b2399bd2
16 changed files with 59 additions and 73 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
path="$1"
expectedContent="$2"
if [ "$path" == "" ]; then
echo "File path not provided"
exit 1
fi
if [ "$expectedContent" == "" ]; then
echo "Expected file contents not provided"
exit 1
fi
if [ ! -f "$path" ]; then
echo "Expected file $path does not exist"
exit 1
fi
actualContent=$(cat $path)
if [ "$actualContent" != "$expectedContent" ];then
echo "File contents are not correct, expected $expectedContent, received $actualContent"
exit 1
fi