File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,17 @@ class JavaCallerCli {
2727 const args = [ ...process . argv ] ;
2828 args . splice ( 0 , 2 ) ;
2929
30- // Parse --no-windows-hide flag
30+ // Parse --no-windows-hide flag (remove all occurrences)
3131 const runOptions = { } ;
32- const noWindowsHideIndex = args . indexOf ( '--no-windows-hide' ) ;
33- if ( noWindowsHideIndex !== - 1 ) {
34- runOptions . windowsHide = false ;
35- args . splice ( noWindowsHideIndex , 1 ) ;
36- }
32+ const filteredArgs = args . filter ( arg => {
33+ if ( arg === '--no-windows-hide' ) {
34+ runOptions . windowsHide = false ;
35+ return false ; // Remove from args
36+ }
37+ return true ; // Keep in args
38+ } ) ;
3739
38- const { status } = await java . run ( args , runOptions ) ;
40+ const { status } = await java . run ( filteredArgs , runOptions ) ;
3941 process . exitCode = status ;
4042 }
4143}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ describe("Call with classes", () => {
6868 checkStdOutIncludes ( `JavaCallerTester is called !` , stdout , stderr ) ;
6969 } ) ;
7070
71- it ( "should call JavaCallerTester.class with windowsHide set to true (default) " , async ( ) => {
71+ it ( "should call JavaCallerTester.class with windowsHide explicitly set to true" , async ( ) => {
7272 const java = new JavaCaller ( {
7373 classPath : 'test/java/dist' ,
7474 mainClass : 'com.nvuillam.javacaller.JavaCallerTester'
You can’t perform that action at this time.
0 commit comments