@@ -243,33 +243,34 @@ public void testJBrowseCli() throws Exception
243243 wrapper .setLogPath (true );
244244 wrapper .setThrowNonZeroExits (false );
245245
246+ File node = AbstractCommandWrapper .resolveFileInPath ("node" , null , false );
247+ if (node == null )
248+ {
249+ _log .info ("Unable to find node in PATH, trying node.exe" );
250+ node = AbstractCommandWrapper .resolveFileInPath ("node.exe" , null , false );
251+ if (node == null )
252+ {
253+ _log .info ("Unable to find node.exe in PATH" );
254+ }
255+ }
256+ _log .info ("node executable location: " + node );
257+
246258 String output = wrapper .executeWithOutput (Arrays .asList (exe .getPath (), "help" ));
247259 if (wrapper .getLastReturnCode () != 0 )
248260 {
249261 _log .error ("Non-zero exit from testJBrowseCli: " + wrapper .getLastReturnCode ());
250262 wrapper .getCommandsExecuted ().forEach (_log ::error );
251263 _log .error ("NODE_PATH: " + System .getenv ("NODE_PATH" ));
252264
253- File node = AbstractCommandWrapper .resolveFileInPath ("node" , null , false );
254- if (node == null )
255- {
256- _log .info ("Unable to find node in PATH, trying node.exe" );
257- node = AbstractCommandWrapper .resolveFileInPath ("node.exe" , null , false );
258- if (node == null )
259- {
260- _log .info ("Unable to find node.exe in PATH" );
261- }
262- }
263-
264- _log .info ("node executable location: " + node );
265-
266265 _log .error ("output: " );
267266 _log .error (output );
268267
269268 // Repeat without output going direct to the server log:
270269 try
271270 {
272- _log .info ("Retrying without all output direct to the system log:" );
271+ // NOTE: this is only useful if "npx pkg --debug" is used when building the executables
272+ _log .info ("Retrying without all output direct to the system log and DEBUG_PKG=1:" );
273+ wrapper .addToEnvironment ("DEBUG_PKG" , "1" );
273274 wrapper .execute (Arrays .asList (exe .getPath (), "help" ));
274275 }
275276 catch (Exception e )
0 commit comments