This repository was archived by the owner on Jun 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
apps/desktop/electron-forge Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 11const child_process = require ( "child_process" ) ;
22const fs = require ( "fs" ) ;
3- const { default : path } = require ( "path" ) ;
3+ const path = require ( "path" ) ;
44
55module . exports = function ( filePath ) {
66 const { WINDOWS_SIGN_EXECUTABLE } = process . env ;
77
8- const stats = fs . lstatSync ( filePath ) ;
9- console . log ( filePath , stats ) ;
10-
118 if ( ! WINDOWS_SIGN_EXECUTABLE ) {
129 console . warn ( "[Sign] Skip signing due to missing environment variable." ) ;
1310 return ;
@@ -19,11 +16,15 @@ module.exports = function (filePath) {
1916 fs . mkdirSync ( outputDir ) ;
2017 }
2118
22- fs . copyFileSync ( sourcePath , destPath ) ;
23-
2419 const command = `${ WINDOWS_SIGN_EXECUTABLE } --executable "${ filePath } "` ;
25- console . log ( `[Sign] ${ command } ` ) ;
20+ console . log ( `[Sign] Running ${ command } ` ) ;
21+
22+ try {
23+ child_process . execSync ( command ) ;
24+ } catch ( e ) {
25+ console . warn ( `[Sign] Unable to sign ${ filePath } due to:\n${ e . stdout . toString ( "utf-8" ) } )}` )
26+ return ;
27+ }
2628
27- const output = child_process . execSync ( command ) ;
28- console . log ( `[Sign] ${ output } ` ) ;
29+ console . log ( `[Sign] Signed ${ filePath } successfully.` ) ;
2930}
You can’t perform that action at this time.
0 commit comments