don't run curl if file exists
This commit is contained in:
parent
9136ba20af
commit
c5dbac0e9c
4
new.sh
4
new.sh
@ -6,6 +6,10 @@ if [ "${1}" != "" ]; then
|
|||||||
padded=$(printf "%02g" ${1})
|
padded=$(printf "%02g" ${1})
|
||||||
mkdir -p ${padded}/inputs
|
mkdir -p ${padded}/inputs
|
||||||
touch ${padded}/inputs/{input,testinput}
|
touch ${padded}/inputs/{input,testinput}
|
||||||
|
if [ ! -f "${padded}/inputs/input" ]; then
|
||||||
curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
|
curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
|
||||||
|
fi
|
||||||
|
if [ ! -f "${padded}/main.go" ]; then
|
||||||
cp -n main.go.tmpl ${padded}/main.go
|
cp -n main.go.tmpl ${padded}/main.go
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user