File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,16 @@ extension AWS.S3.Client
54
54
as path: String ) async throws
55
55
{
56
56
let release : FilePath . Directory = scratch / " release "
57
- let executable : FilePath = release / name
58
- let compressed : FilePath = release / " \( name) .gz "
57
+ let archive : FilePath = release / " \( name) .tar.gz "
59
58
60
59
print ( " Compressing \( name) ... " )
61
60
62
- try SystemProcess . init ( command: " gzip " , " -kf " , " \( executable) " ) ( )
63
- let file : [ UInt8 ] = try compressed. read ( )
61
+ try SystemProcess . init ( command: " tar " ,
62
+ " --use-compress-program='gzip -9' " ,
63
+ " -C " , " \( release) " ,
64
+ " -cf " , " \( archive) " ,
65
+ name) ( )
66
+ let file : [ UInt8 ] = try archive. read ( )
64
67
65
68
try await self . connect
66
69
{
@@ -72,7 +75,7 @@ extension AWS.S3.Client
72
75
// These could be big files, even compressed, so we need to increase the timeout.
73
76
try await $0. put ( object: object,
74
77
using: . standard,
75
- path: " \( path) .gz " ,
78
+ path: " \( path) .tar. gz " ,
76
79
with: key,
77
80
timeout: . seconds( 1200 ) )
78
81
}
You can’t perform that action at this time.
0 commit comments