@@ -197,7 +197,7 @@ async function unpack(prepareOptions: PrepareApplicationStageDirectoryOptions, d
197
197
const electronDistHook : any = await resolveFunction ( packager . appInfo . type , packager . config . electronDist , "electronDist" )
198
198
resolvedDist = typeof electronDistHook === "function" ? await Promise . resolve ( electronDistHook ( prepareOptions ) ) : electronDistHook
199
199
} catch ( error : any ) {
200
- throw new Error ( " Failed to resolve electronDist: " + error . message )
200
+ throw new Error ( ` Failed to resolve electronDist: ${ error . message } ${ error . stack } ` )
201
201
}
202
202
203
203
if ( resolvedDist == null ) {
@@ -239,20 +239,20 @@ async function unpack(prepareOptions: PrepareApplicationStageDirectoryOptions, d
239
239
} )
240
240
return false
241
241
}
242
- }
242
+ // if we reach here, it means the provided electronDist is neither a zip file nor a directory with the default zip file
243
+ // e.g. we treat it as a custom already-unpacked Electron distribution
244
+ log . info ( { electronDist : log . filePath ( resolvedDist ) } , "using custom unpacked Electron distribution" )
245
+ const source = packager . getElectronSrcDir ( resolvedDist )
246
+ const destination = packager . getElectronDestinationDir ( appOutDir )
247
+ log . info ( { source, destination } , "copying unpacked Electron" )
248
+ await emptyDir ( appOutDir )
249
+ await copyDir ( source , destination , {
250
+ isUseHardLink : DO_NOT_USE_HARD_LINKS ,
251
+ } )
243
252
244
- // if we reach here, it means the provided electronDist is neither a zip file nor a directory with the default zip file
245
- // e.g. we treat it as a custom already-unpacked Electron distribution
246
- log . info ( { electronDist : log . filePath ( resolvedDist ) } , "using custom unpacked Electron distribution" )
247
- const source = packager . getElectronSrcDir ( resolvedDist )
248
- const destination = packager . getElectronDestinationDir ( appOutDir )
249
- log . info ( { source, destination } , "copying unpacked Electron" )
250
- await emptyDir ( appOutDir )
251
- await copyDir ( source , destination , {
252
- isUseHardLink : DO_NOT_USE_HARD_LINKS ,
253
- } )
254
-
255
- return false
253
+ return false
254
+ }
255
+ throw new Error ( "Unable to unpack electron dist" )
256
256
}
257
257
258
258
function cleanupAfterUnpack ( prepareOptions : PrepareApplicationStageDirectoryOptions , distMacOsAppName : string , isFullCleanup : boolean ) {
0 commit comments