diff --git a/bin/plagiarize b/bin/plagiarize new file mode 100755 index 0000000..593cde5 --- /dev/null +++ b/bin/plagiarize @@ -0,0 +1,24 @@ +#!/bin/zsh + +# Copy one folder to another, renaming all files inside to match +# Useful for weekly reports, where the folder and the files inside +# (all the many latex files) include the date + +set -e + +src=$1 +dst=$2 + +if [ -z $dst ]; then + echo "No destination" + return 1 +fi +if [ -e $dst ]; then + echo "Destination already exists" + return 1 +fi +cp -r $src $dst +cd $dst +# echo "rename $(basename $src) $(basename $dst) *" +# rename $(basename $src) $(basename $dst) * +rename "s/$(basename $src)/$(basename $dst)/" * diff --git a/zsh/custom/functions.zsh b/zsh/custom/functions.zsh index 7ddd1e7..8c3b7e5 100644 --- a/zsh/custom/functions.zsh +++ b/zsh/custom/functions.zsh @@ -94,26 +94,6 @@ function yay() { command yay "$@" } -# Copy one folder to another, renaming all files inside to match -# Useful for weekly reports, where the folder and the files inside -# (all the many latex files) include the date -function plagiarise() { - - src=$(basename $1) - dst=$(basename $2) - - if [ -z $dst ]; then - echo "No destination" - return 1 - fi - if [ -e $dst ]; then - echo "Destination already exists" - return 1 - fi - cp -r $src $dst - cd $dst - rename $src $dst * -} function poster() { ffmpeg -i $1 -r 1 -f image2 $2 }