Added an option to wipe the current directory.

Crude implementation currently, but it appears to work. Good enough.
master
Taha Ahmed 13 years ago
parent 1b13d6e27d
commit 07ce71f33f

@ -108,6 +108,7 @@ else
echo "This is cheRTeX POST-PROCESSING" # only one choice for now echo "This is cheRTeX POST-PROCESSING" # only one choice for now
echo "<1> 'pdf-all' -- Process all .tikz files to pdf graphics" echo "<1> 'pdf-all' -- Process all .tikz files to pdf graphics"
echo "<2> 'clean-up' -- Remove all auxiliary files" echo "<2> 'clean-up' -- Remove all auxiliary files"
echo "<3> 'wipe-dir' -- Remove all non-essential files and subdirectories"
echo "Any other input exits the program" echo "Any other input exits the program"
read usrchoice read usrchoice
@ -157,7 +158,25 @@ else
if [[ $usrchoice == "clean-up" || $usrchoice == "2" ]]; then if [[ $usrchoice == "clean-up" || $usrchoice == "2" ]]; then
echo "<2> 'clean-up' chosen" echo "<2> 'clean-up' chosen"
rm $auxfiles rm $auxfiles
# Still a rather crude way of cleaning up... # Still, a rather crude way of cleaning up...
fi
if [[ $usrchoice == "wipe-dir" || $usrchoice == "3" ]]; then
echo "<3> 'wipe-dir' chosen"
## Remove all but non-essential files
# get the name of the current directory
currdirname=${PWD##*/}
# make a directory in chepec/tmp with the name of the current dir
mkdir /home/taha/chepec/tmp/$currdirname
# Copy the contents of the current directory to the tmp/$currdirname directory
cp * -R /home/taha/chepec/tmp/$currdirname
# Empty the current directory of all contents
rm * -R # note: hidden files and subdir unaffected
# Return the stuff we want to keep after wipe-dir
cp /home/taha/chepec/tmp/$currdirname/*.Rnw .
cp /home/taha/chepec/tmp/$currdirname/vc .
cp /home/taha/chepec/tmp/$currdirname/vc.tex .
cp /home/taha/chepec/tmp/$currdirname/vc-git.awk .
fi fi
echo "Terminating..." echo "Terminating..."

Loading…
Cancel
Save