@@ -25,9 +25,7 @@ function getAvailablePort() {
2525}
2626
2727function resolveCommand ( execPath , execName ) {
28- const command = commandExistsSync ( execName )
29- ? execName
30- : executablePath ( execPath , execName ) ;
28+ const command = commandExistsSync ( execName ) ? execName : executablePath ( execPath , execName ) ;
3129 return command ;
3230}
3331
@@ -52,10 +50,7 @@ async function runScript(
5250 } ) ;
5351
5452 const controller = new AbortController ( ) ;
55- const timer = setTimeout (
56- ( ) => controller . abort ( ) ,
57- timeoutSeconds * MILLISECONDS_PER_SECOND ,
58- ) ;
53+ const timer = setTimeout ( ( ) => controller . abort ( ) , timeoutSeconds * MILLISECONDS_PER_SECOND ) ;
5954 if ( typeof timer . unref === "function" ) timer . unref ( ) ;
6055
6156 try {
@@ -80,11 +75,16 @@ async function runBack(execName, execPath, args = {}) {
8075 }
8176 const port = await getAvailablePort ( ) ;
8277 const backArgs = [
83- "--port" , String ( port ) ,
84- "--data_folder_path" , projectFolderPath ,
85- "--upload_folder_path" , uploadFolderPath ,
86- "--allowed_origin" , "http://localhost:*" ,
87- "--timeout" , "0" ,
78+ "--port" ,
79+ String ( port ) ,
80+ "--data_folder_path" ,
81+ projectFolderPath ,
82+ "--upload_folder_path" ,
83+ uploadFolderPath ,
84+ "--allowed_origin" ,
85+ "http://localhost:*" ,
86+ "--timeout" ,
87+ "0" ,
8888 ] ;
8989 if ( process . env . NODE_ENV === "development" || ! process . env . NODE_ENV ) {
9090 backArgs . push ( "--debug" ) ;
@@ -101,9 +101,12 @@ async function runViewer(execName, execPath, args = {}) {
101101 }
102102 const port = await getAvailablePort ( ) ;
103103 const viewerArgs = [
104- "--port" , String ( port ) ,
105- "--data_folder_path" , projectFolderPath ,
106- "--timeout" , "0" ,
104+ "--port" ,
105+ String ( port ) ,
106+ "--data_folder_path" ,
107+ projectFolderPath ,
108+ "--timeout" ,
109+ "0" ,
107110 ] ;
108111 console . log ( "runViewer" , execPath , execName , viewerArgs ) ;
109112 await runScript ( execPath , execName , viewerArgs , "Starting factory" ) ;
0 commit comments