Add extra option to create a folder during download

This commit is contained in:
Konrad Pabjan 2020-04-30 16:00:01 +02:00
parent 1de1dea89c
commit 731ed00a75
8 changed files with 133 additions and 65 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, recieved $actualContent"
exit 1
fi