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
echo "Merci de se déplacer dans le répertoire approprié"
exit 0
fi;
YEAR=$(date +%Y)
DAY=$(date +%d)
DAY="$1"
YEAR="$2"
FILENAME="${YEAR}/day${DAY}.py"
cp utils/template.py "$FILENAME"