File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1215,9 +1215,8 @@ mod test {
12151215 }
12161216
12171217 // ToDo: `tsgolint` does not support `big-endian`?
1218- // ToDo: windows: my guess is the missing `.exe` suffix when searching
12191218 #[ test]
1220- #[ cfg( not( any ( target_os = "windows" , target_endian = "big" ) ) ) ]
1219+ #[ cfg( not( target_endian = "big" ) ) ]
12211220 fn test_tsgolint ( ) {
12221221 let args = & [ "--type-aware" ] ;
12231222 Tester :: new ( ) . with_cwd ( "fixtures/tsgolint" . into ( ) ) . test_and_snapshot ( args) ;
Original file line number Diff line number Diff line change @@ -369,10 +369,14 @@ pub fn try_find_tsgolint_executable(cwd: &Path) -> Option<PathBuf> {
369369 }
370370 }
371371
372+ // executing a sub command in windows, needs a `cmd` or `ps1` extension.
373+ // `cmd` is the most compatible one with older systems
374+ let file = if cfg ! ( windows) { "tsgolint.CMD" } else { "tsgolint" } ;
375+
372376 // Move upwards until we find a `package.json`, then look at `node_modules/.bin/tsgolint`
373377 let mut current_dir = cwd. to_path_buf ( ) ;
374378 loop {
375- let node_modules_bin = current_dir. join ( "node_modules" ) . join ( ".bin" ) . join ( "tsgolint" ) ;
379+ let node_modules_bin = current_dir. join ( "node_modules" ) . join ( ".bin" ) . join ( file ) ;
376380 if node_modules_bin. exists ( ) {
377381 return Some ( node_modules_bin) ;
378382 }
You can’t perform that action at this time.
0 commit comments