File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -572,6 +572,7 @@ function payloadFileSync(pointer) {
572572 // ///////////////////////////////////////////////////////////////
573573
574574 function removeTemporaryFolderAndContent ( folder ) {
575+ if ( ! folder ) return ;
575576 if ( NODE_VERSION_MAJOR <= 14 ) {
576577 if ( NODE_VERSION_MAJOR <= 10 ) {
577578 // folder must be empty
@@ -588,11 +589,12 @@ function payloadFileSync(pointer) {
588589 }
589590 const temporaryFiles = { } ;
590591 const os = require ( 'os' ) ;
591- const tmpFolder = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'pkg-' ) ) ;
592+ let tmpFolder = '' ;
592593 process . on ( 'beforeExit' , ( ) => {
593594 removeTemporaryFolderAndContent ( tmpFolder ) ;
594595 } ) ;
595596 function deflateSync ( snapshotFilename ) {
597+ if ( ! tmpFolder ) tmpFolder = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'pkg-' ) ) ;
596598 const content = fs . readFileSync ( snapshotFilename , { encoding : 'binary' } ) ;
597599 // content is already unziped !
598600 const hash = createHash ( 'sha256' ) . update ( content ) . digest ( 'hex' ) ;
You can’t perform that action at this time.
0 commit comments