Skip to content

Commit 476c8e9

Browse files
committed
Use bash always
1 parent dc45399 commit 476c8e9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/rust-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: cargo test build
4646
run: cargo build --tests --release
4747
- name: cargo test
48+
shell: bash
4849
run: cargo test --release
4950
- name: detects powershell
5051
if: ${{ matrix.os != 'macos-14' }}

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ pub fn is_powershell_parent() -> bool {
362362
(ustr.length >> 1) as usize,
363363
));
364364

365-
let path = os.to_string_lossy();
366-
eprintln!("{path}");
367-
let p = std::path::Path::new(path.as_ref());
368-
if p.file_stem() == Some(std::ffi::OsStr::new("pwsh")) {
369-
return true;
365+
let path = std::path::Path::new(&os);
366+
if let Some(stem) = path.file_stem().and_then(|stem| stem.to_str()) {
367+
if stem == "pwsh" || stem == "powershell" {
368+
return true;
369+
}
370370
}
371371
}
372372

0 commit comments

Comments
 (0)