From 7216a7ed87d835db85924505799787f6f53be46f Mon Sep 17 00:00:00 2001 From: augustin64 Date: Wed, 1 Dec 2021 21:44:27 +0100 Subject: [PATCH] Update new_day.sh --- utils/new_day.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/new_day.sh b/utils/new_day.sh index b52984e..fed289b 100755 --- a/utils/new_day.sh +++ b/utils/new_day.sh @@ -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"