Update new_day.sh

This commit is contained in:
augustin64 2021-12-01 21:44:27 +01:00
parent 3dd31b7a37
commit 7216a7ed87

View File

@ -1,10 +1,13 @@
[[ $1 ]] | set -- $(date +%d)
[[ $2 ]] | set -- $(date +%Y)
if [[ ! -e .git ]]; then if [[ ! -e .git ]]; then
echo "Merci de se déplacer dans le répertoire approprié" echo "Merci de se déplacer dans le répertoire approprié"
exit 0 exit 0
fi; fi;
YEAR=$(date +%Y) DAY="$1"
DAY=$(date +%d) YEAR="$2"
FILENAME="${YEAR}/day${DAY}.py" FILENAME="${YEAR}/day${DAY}.py"
cp utils/template.py "$FILENAME" cp utils/template.py "$FILENAME"