Skip to content

Commit

Permalink
Use bash always
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Nov 18, 2024
1 parent dc45399 commit 476c8e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: cargo test build
run: cargo build --tests --release
- name: cargo test
shell: bash
run: cargo test --release
- name: detects powershell
if: ${{ matrix.os != 'macos-14' }}
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ pub fn is_powershell_parent() -> bool {
(ustr.length >> 1) as usize,
));

let path = os.to_string_lossy();
eprintln!("{path}");
let p = std::path::Path::new(path.as_ref());
if p.file_stem() == Some(std::ffi::OsStr::new("pwsh")) {
return true;
let path = std::path::Path::new(&os);
if let Some(stem) = path.file_stem().and_then(|stem| stem.to_str()) {
if stem == "pwsh" || stem == "powershell" {
return true;
}
}
}

Expand Down

0 comments on commit 476c8e9

Please sign in to comment.