Skip to content

Commit 9d4904d

Browse files
authored
Merge pull request #14095 from gforney/master
FDS vv: add -z option to Common_Run_All.sh script. Now -y removes ex…
2 parents bdb434f + 3d5d53a commit 9d4904d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Validation/Common_Run_All.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ echo "-v - show script run by qfds.sh for each validation case"
7373
echo "-V - show qfds.sh command line for each validation case"
7474
echo "-w walltime - default: empty, PBS: hh:mm:ss, SLURM: dd-hh:mm:ss"
7575
echo "-x - do not copy FDS input files"
76-
echo "-y - overwrite existing files"
76+
echo "-y - remove existing files"
77+
echo "-z - overwrite existing files"
7778
exit
7879
}
7980

8081
DEBUG=
81-
while getopts 'bCe:EhIj:m:o:Oq:r:suvVw:xy' OPTION
82+
while getopts 'bCe:EhIj:m:o:Oq:r:suvVw:xyz' OPTION
8283
do
8384
case $OPTION in
8485
b)
@@ -141,7 +142,12 @@ case $OPTION in
141142
export DONOTCOPY=1
142143
;;
143144
y)
145+
export DELETEFILES=1
146+
export OVERWRITE=
147+
;;
148+
z)
144149
export OVERWRITE=1
150+
export DELETEFILES=
145151
;;
146152
esac
147153
done
@@ -174,12 +180,12 @@ if [ ! $STOPFDS ] ; then
174180
# Check for existence of $INDIR (Current_Results) directory
175181
if [ -d "$INDIR" ]; then
176182
# Check for files in $INDIR (Current_Results) directory
177-
if [[ "$(ls -A $INDIR)" && ! $OVERWRITE ]]; then
178-
echo "Directory $INDIR already exists with files."
179-
echo "Use the -y option to REMOVE existing files."
183+
if [[ "$(ls -A $INDIR)" && "$OVERWRITE" == "" && "$DELETEFILES" == "" ]]; then
184+
echo "The directory $INDIR already exists with files."
185+
echo "Use the -y option to REMOVE existing files or -z to OVERWRITE existing files"
180186
echo "Exiting."
181187
exit
182-
elif [[ "$(ls -A $INDIR)" && $OVERWRITE ]]; then
188+
elif [[ "$(ls -A $INDIR)" && "$DELETEFILES" == "1" ]]; then
183189
rm $INDIR/*
184190
fi
185191
# Create $INDIR (Current_Results) directory if it doesn't exist

0 commit comments

Comments
 (0)