#
cd $TARGET_BASE/$TARGET_NAME
# loop through all results of current target
-for i in $(ls -atd1) ; do
+for i in $(ls -at1) ; do
echo $i
- # check if the jenkins build log still exists, if not, delete the old target as well
- if [ "$i" != "." ] && [ ! -L $JOB_HOME/$i ] ; then
+ # check if the jenkins build log still exists (and doesnt start with ".")
+ # and if not, delete the old target as well
+ if [ ! -L $JOB_HOME/$i ] && [ "$i:0:1" != "." ] ; then
echo sudo rm -rfv ./$i
else
echo "keeping $i"