File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,21 +52,6 @@ const getFileChecksum = async (filePath) => new Promise((resolve) => {
5252 checksum . file ( filePath , { algorithm : 'sha256' } , ( _ , hash ) => resolve ( hash ) ) ;
5353} ) ;
5454
55- const unpackFile = async ( filePath , destinationPath ) => tar . extract ( {
56- cwd : destinationPath ,
57- file : filePath
58- } ) ;
59-
60- const packBundle = async ( context , sourcePaths , destinationFile ) => tar . create (
61- {
62- cwd : context ,
63- file : destinationFile ,
64- gzip : true
65- } ,
66- sourcePaths
67- ) ;
68-
69-
7055const bundleGit = ( {
7156 buildDirectory,
7257 expectedChecksum,
@@ -107,20 +92,20 @@ const bundleGit = ({
10792
10893 mkdirp . sync ( vendorDirectoryPath ) ;
10994
110- fs . copyFile ( gitRsBinaryPath , path . join ( buildDirectory , gitRsBinaryName ) , ( error ) => {
111- if ( error ) {
112- console . log ( `Could not copy git-rs binaries` ) ;
113- process . exit ( 1 ) ;
114- }
115- } ) ;
95+ fs . copyFileSync ( gitRsBinaryPath , path . join ( buildDirectory , gitRsBinaryName ) ) ;
11696
11797 try {
118- await unpackFile ( tempFile , vendorDirectoryPath ) ;
98+ await tar . extract ( {
99+ cwd : vendorDirectoryPath ,
100+ file : tempFile
101+ } ) ;
119102 } catch ( error ) {
120103 console . log ( 'Could not extract git archive' ) ;
121104 process . exit ( 1 ) ;
122105 }
123106
107+ fs . unlinkSync ( path . join ( tempFile ) ) ;
108+
124109 try {
125110 zip . zipSync ( buildDirectory , `${ process . env . TARGET } .zip` ) ;
126111 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments