@@ -21,45 +21,6 @@ const logConfiguration = () => {
2121 console . log ( "===========================\n" ) ;
2222} ;
2323
24- // Build parameters construction
25- const buildParameters = ( ) => {
26- const params = [
27- "dist/cli.js" ,
28- process . env . URL ,
29- "--name" ,
30- process . env . NAME ,
31- "--height" ,
32- process . env . HEIGHT ,
33- "--width" ,
34- process . env . WIDTH ,
35- ] ;
36-
37- if ( process . env . HIDE_TITLE_BAR === "true" && process . platform === "darwin" ) {
38- params . push ( "--hide-title-bar" ) ;
39- }
40-
41- if ( process . env . FULLSCREEN === "true" ) {
42- params . push ( "--fullscreen" ) ;
43- }
44-
45- if ( process . env . MULTI_ARCH === "true" && process . platform === "darwin" ) {
46- // We'll handle rustup separately since it's a different command
47- params . push ( "--multi-arch" ) ;
48- }
49-
50- if ( process . env . TARGETS && process . platform === "linux" ) {
51- params . push ( "--targets" , process . env . TARGETS ) ;
52- }
53-
54- if ( process . platform === "win32" || process . platform === "linux" ) {
55- params . push ( "--show-system-tray" ) ;
56- }
57-
58- return params ;
59- } ;
60-
61- // Icon will be handled directly by CLI
62-
6324// Main execution
6425const main = async ( ) => {
6526 try {
@@ -68,9 +29,40 @@ const main = async () => {
6829 const cliPath = path . join ( process . cwd ( ) , "node_modules/pake-cli" ) ;
6930 process . chdir ( cliPath ) ;
7031
71- let params = buildParameters ( ) ;
32+ // Build CLI parameters
33+ let params = [
34+ "dist/cli.js" ,
35+ process . env . URL ,
36+ "--name" ,
37+ process . env . NAME ,
38+ "--height" ,
39+ process . env . HEIGHT ,
40+ "--width" ,
41+ process . env . WIDTH ,
42+ ] ;
43+
44+ if (
45+ process . env . HIDE_TITLE_BAR === "true" &&
46+ process . platform === "darwin"
47+ ) {
48+ params . push ( "--hide-title-bar" ) ;
49+ }
50+
51+ if ( process . env . FULLSCREEN === "true" ) {
52+ params . push ( "--fullscreen" ) ;
53+ }
7254
73- // Multi-arch target is now handled in GitHub Actions workflow
55+ if ( process . env . MULTI_ARCH === "true" && process . platform === "darwin" ) {
56+ params . push ( "--multi-arch" ) ;
57+ }
58+
59+ if ( process . env . TARGETS && process . platform === "linux" ) {
60+ params . push ( "--targets" , process . env . TARGETS ) ;
61+ }
62+
63+ if ( process . platform === "win32" || process . platform === "linux" ) {
64+ params . push ( "--show-system-tray" ) ;
65+ }
7466
7567 // Add icon parameter if provided - CLI will handle download and conversion
7668 if ( process . env . ICON && process . env . ICON !== "" ) {
@@ -84,8 +76,9 @@ const main = async () => {
8476 console . log ( "Pake parameters:" , params . join ( " " ) ) ;
8577 console . log ( "Compiling...." ) ;
8678
87- // Execute the CLI command
88- await execa ( "node" , params , { stdio : "inherit" } ) ;
79+ // Execute the CLI command with extended timeout
80+ const timeout = 900000 ; // 15 minutes for all builds
81+ await execa ( "node" , params , { stdio : "inherit" , timeout } ) ;
8982
9083 // Create output directory if it doesn't exist
9184 if ( ! fs . existsSync ( "output" ) ) {
@@ -117,7 +110,8 @@ const main = async () => {
117110 for ( const file of bundleFiles ) {
118111 const srcPath = path . join ( buildPath , file ) ;
119112 const destPath = path . join ( "output" , path . basename ( file ) ) ;
120- await execa ( "cp" , [ srcPath , destPath ] ) ;
113+ // Use fs.copyFileSync for cross-platform compatibility
114+ fs . copyFileSync ( srcPath , destPath ) ;
121115 }
122116 break ; // Found files, no need to check other paths
123117 }
@@ -129,7 +123,9 @@ const main = async () => {
129123 let foundFiles = false ;
130124 for ( const file of files ) {
131125 if ( namePattern . test ( file ) ) {
132- await execa ( "mv" , [ file , path . join ( "output" , file ) ] ) ;
126+ // Use fs for cross-platform file operations
127+ const destPath = path . join ( "output" , file ) ;
128+ fs . renameSync ( file , destPath ) ;
133129 foundFiles = true ;
134130 }
135131 }
0 commit comments