File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
Nodejs/Product/PressAnyKey Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,30 @@ private static int Main(string[] args)
3333 proc . WaitForExit ( ) ;
3434 exitCode = proc . ExitCode ;
3535 }
36- catch ( Win32Exception exc )
36+ catch ( Win32Exception )
3737 {
38- Console . WriteLine ( $ "Failed to start process: '{ exc . Message } '.") ;
39- Console . WriteLine ( "Probable cause is the Nodejs exe is corrupt, please re-install." ) ;
38+ Console . WriteLine ( "Failed to start process." ) ;
39+ Console . WriteLine ( "Probable cause is the Node.js exe is corrupt, please re-install." ) ;
40+ Console . WriteLine ( $ "path: '{ args [ 2 ] } '.") ;
4041 exitCode = - 1 ;
4142 }
4243
43- if ( args [ 0 ] == "both" ||
44- ( exitCode == 0 && args [ 0 ] == "normal" ) ||
45- ( exitCode != 0 && args [ 0 ] == "abnormal" ) )
44+ var shouldWait = true ;
45+
46+ switch ( args [ 0 ] )
47+ {
48+ case "both" :
49+ shouldWait = true ;
50+ break ;
51+ case "normal" :
52+ shouldWait = exitCode == 0 ;
53+ break ;
54+ case "abnormal" :
55+ shouldWait = exitCode != 0 ;
56+ break ;
57+ }
58+
59+ if ( shouldWait )
4660 {
4761 Console . Write ( "Press any key to continue..." ) ;
4862 Console . ReadKey ( ) ;
You can’t perform that action at this time.
0 commit comments