Skip to content

Commit fd8e3f2

Browse files
author
Tom Barnes
committed
Fix outfile name change in archive.sh
1 parent d0db029 commit fd8e3f2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/integration-tests/bash/archive.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@ function fail {
2424
function archive {
2525
local SOURCE_DIR="${1?}"
2626
local ARCHIVE_DIR="${2?}"
27-
local ARCHIVE="$ARCHIVE_DIR/IntSuite.`date '+%Y%m%d%H%M%S'`.tar.gz"
27+
local ARCHIVE_FILE="IntSuite.`date '+%Y%m%d%H%M%S'`.tar.gz"
28+
local ARCHIVE="$ARCHIVE_DIR/$ARCHIVE_FILE"
29+
local OUTFILE="/tmp/$ARCHIVE_FILE"
2830

2931
trace About to archive \'$SOURCE_DIR\'.
3032

3133
[ ! -d "$SOURCE_DIR" ] && fail Could not archive, could not find source directory \'$SOURCE_DIR\'.
3234

3335
mkdir -p $ARCHIVE_DIR || fail Could not archive, could not create target directory \'$ARCHIVE_DIR\'.
3436

35-
local outfile=/tmp/${ARCHIVE}.out
36-
tar -czf $ARCHIVE $SOURCE_DIR > $outfile 2>&1
37-
[ $? -eq 0 ] || fail "Could not archive, 'tar -czf $ARCHIVE $SOURCE_DIR' command failed: `cat $outfile`"
38-
rm -f $outfile
37+
tar -czf $ARCHIVE $SOURCE_DIR > $OUTFILE 2>&1
38+
[ $? -eq 0 ] || fail "Could not archive, 'tar -czf $ARCHIVE $SOURCE_DIR' command failed: `cat $OUTFILE`"
39+
rm -f $OUTFILE
3940

4041
find $ARCHIVE_DIR -maxdepth 1 -name "IntSuite*tar.gz" | sort -r | awk '{ if (NR>5) print $NF }' | xargs rm -f
4142

0 commit comments

Comments
 (0)