Added *.Rmd files to the set of returned files after directory wipe (option 3).

master
Taha Ahmed 12 years ago
parent f4252bf9c2
commit 8f939e4d83

@ -177,11 +177,14 @@ else
# Empty the current directory of all contents # Empty the current directory of all contents
rm * -R # note: hidden files and subdir unaffected rm * -R # note: hidden files and subdir unaffected
# Return the stuff we want to keep after wipe-dir # Return the stuff we want to keep after wipe-dir
# (we are of course assuming that the following 4 file(type)s always exist)
# (if in fact they do not exist, use conditional statements instead (see below)
cp /home/taha/chepec/tmp/$tmpdirname/*.Rnw . cp /home/taha/chepec/tmp/$tmpdirname/*.Rnw .
cp /home/taha/chepec/tmp/$tmpdirname/vc . cp /home/taha/chepec/tmp/$tmpdirname/vc .
cp /home/taha/chepec/tmp/$tmpdirname/vc.tex . cp /home/taha/chepec/tmp/$tmpdirname/vc.tex .
cp /home/taha/chepec/tmp/$tmpdirname/vc-git.awk . cp /home/taha/chepec/tmp/$tmpdirname/vc-git.awk .
# Return stuff that may not always exist (check first...) ## Return stuff that may not always exist (check first...)
## The use of conditionals is mainly to avoid annoying "file does not exist" messages...
# Return *.Rproj file (removal is unnecessary and makes RStudio less useful) # Return *.Rproj file (removal is unnecessary and makes RStudio less useful)
Rprojfiles=`ls -1 /home/taha/chepec/tmp/$tmpdirname/*.Rproj 2>/dev/null | wc -l` Rprojfiles=`ls -1 /home/taha/chepec/tmp/$tmpdirname/*.Rproj 2>/dev/null | wc -l`
if [ $Rprojfiles != 0 ]; then if [ $Rprojfiles != 0 ]; then
@ -192,6 +195,11 @@ else
if [ $rdafiles != 0 ]; then if [ $rdafiles != 0 ]; then
cp /home/taha/chepec/tmp/$tmpdirname/*.rda . cp /home/taha/chepec/tmp/$tmpdirname/*.rda .
fi fi
# Return *.Rmd files (R markdown source files)
Rmdfiles=`ls -1 /home/taha/chepec/tmp/$tmpdirname/*.Rmd 2>/dev/null | wc -l`
if [ $Rmdfiles != 0 ]; then
cp /home/taha/chepec/tmp/$tmpdirname/*.Rmd .
fi
fi fi
echo "Terminating..." echo "Terminating..."

Loading…
Cancel
Save