diff --git a/chertex.sh b/chertex.sh index b39ca54..9d8cd98 100755 --- a/chertex.sh +++ b/chertex.sh @@ -178,11 +178,12 @@ else rm * -R # note: hidden files and subdir unaffected # Return the stuff we want to keep after wipe-dir cp /home/taha/chepec/tmp/$tmpdirname/*.Rnw . - cp /home/taha/chepec/tmp/$tmpdirname/vc .e + cp /home/taha/chepec/tmp/$tmpdirname/vc . cp /home/taha/chepec/tmp/$tmpdirname/vc.tex . cp /home/taha/chepec/tmp/$tmpdirname/vc-git.awk . - # Ditto for the stuff that may not always exist... - if [ -e *.Rproj ]; then + # Return stuff that may not always exist (check first...) + Rprojfiles=`ls -1 /home/taha/chepec/tmp/$tmpdirname/*.Rproj 2>/dev/null | wc -l` + if [ $Rprojfiles != 0 ]; then cp /home/taha/chepec/tmp/$tmpdirname/*.Rproj . fi fi