Skip to content
Snippets Groups Projects
Commit 0067c9e3 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: avoid spurious messages when cloning cases

- either (or both) of 0/, 0.orig/ may exist, so error messages about
  one of them being missing is a bit misleading
parent ff2a3353
Branches
Tags
No related merge requests found
...@@ -208,19 +208,32 @@ compileApplication() ...@@ -208,19 +208,32 @@ compileApplication()
wmake $1 wmake $1
} }
#
# cloneCase srcDir dstDir
#
cloneCase() cloneCase()
{ {
if [ -d "$2" ] if [ -e "$2" ]
then then
echo "Case already cloned: remove case directory $2 to clone" echo "Case already cloned: remove case directory $2 to clone"
else elif [ -d "$1" ]
then
echo "Cloning $2 case from $1" echo "Cloning $2 case from $1"
mkdir $2 mkdir $2
cpfiles="0.orig 0 system constant" # These must exist, so do not hide error messages
for f in $cpfiles for f in system constant
do do
\cp -r $1/$f $2 \cp -r $1/$f $2
done done
# Either (or both) may exist, so error messages may be spurious
for f in 0 0.orig
do
\cp -r $1/$f $2 2>/dev/null
done
else
echo "Error: cannot clone from non-existent directory"
echo " $1"
fi fi
} }
...@@ -243,7 +256,7 @@ restore0Dir() ...@@ -243,7 +256,7 @@ restore0Dir()
if [ -d 0.orig ] if [ -d 0.orig ]
then then
\rm -rf 0 \rm -rf 0
\cp -r 0.orig 0 > /dev/null 2>&1 \cp -r 0.orig 0 2>/dev/null
else else
echo " Warning: no 0.orig/ found" echo " Warning: no 0.orig/ found"
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment