diff --git a/utils/new_day.sh b/utils/new_day.sh index 7fa9bde..d137e00 100755 --- a/utils/new_day.sh +++ b/utils/new_day.sh @@ -10,9 +10,17 @@ DAY="$1" YEAR="$2" FILENAME="${YEAR}/day${DAY}.py" -python utils/cli.py download -y $YEAR -d $DAY -python utils/cli.py show -y $YEAR -d $DAY - cp utils/template.py "$FILENAME" sed -i "s/DAY/${DAY}/" "$FILENAME" sed -i "s/YEAR/${YEAR}/" "$FILENAME" +codium "$PWD" "$PWD/$FILENAME" + +if [[ $(date +%H) -lt 6 ]]; then + SECONDS_UNTIL_START=$(( $(date -f - +%s- <<< "today 06:00"$'\nnow') 0 )) + echo "Waiting ${SECONDS_UNTIL_START} seconds.." + sleep $SECONDS_UNTIL_START; +fi; +echo "Goooooo !" + +python utils/cli.py download -y $YEAR -d $DAY +python utils/cli.py show -y $YEAR -d $DAY \ No newline at end of file