#!/run/current-system/sw/bin/bash # Check if: # default.nix # default.yaml # header.tex # Makefile # slides.md # exists # if not, copy from templates BEAMERTEMP="/path/to/your/templates/beamer" SLIDES="slides.md" TODAY=$(date +%F) check_and_copy () { if test -f $1 then echo "Using current $1" else echo "Creating $1" cp "$BEAMERTEMP/$1" $1 # set slides date to today if [ $1 == $SLIDES ] then sed -i "s/^date:.*$/date: $TODAY/" $SLIDES fi fi } check_and_copy "default.nix" check_and_copy "default.yaml" check_and_copy "header.tex" check_and_copy "Makefile" check_and_copy $SLIDES