Skip to content

Commit 94c0ef8

Browse files
authored
fix s3-cat script for good (#3171)
alright tried this out locally so this should be fixed for good now
1 parent 370d30a commit 94c0ef8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/cat-s3.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ while (( n_failures < 2 )); do
2323
}
2424

2525
if [[ "$key" =~ \.gz$ ]]; then
26-
local_uncompressed=$(mktemp)
26+
local_decompressed=$(mktemp)
27+
local_decompressed_concat=$(mktemp)
2728
gzip -d -c "$local_copy" > "$local_decompressed"
28-
cat "$local_decompressed" "$local_file_to_concatenate" > "$local_uncompressed"
29-
gzip -c "$local_uncompressed" > "$local_concatenated"
29+
cat "$local_decompressed" "$local_file_to_concatenate" > "$local_decompressed_concat"
30+
gzip -c "$local_decompressed_concat" > "$local_concatenated"
31+
rm "$local_decompressed" "$local_decompressed_concat"
3032
else
3133
cat $local_copy $local_file_to_concatenate > $local_concatenated
3234
fi

0 commit comments

Comments
 (0)