Skip to content

Commit

Permalink
[zsh] Move plagiarize to bin and make more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelRobitaille committed Oct 10, 2022
1 parent 64149d1 commit 85800fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
24 changes: 24 additions & 0 deletions bin/plagiarize
Original file line number Diff line number Diff line change
@@ -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)/" *
20 changes: 0 additions & 20 deletions zsh/custom/functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 85800fb

Please sign in to comment.