fix(bash): normalize msys pidfile paths

This commit is contained in:
can1357
2026-08-13 01:02:04 +02:00
parent f1057bf96f
commit d97e53cd51
+16 -4
View File
@@ -887,11 +887,11 @@ fn parse_states(value: &str, target: &mut HashSet<char>) -> std::result::Result<
}
fn resolve_shell_path(cwd: &Path, value: &str) -> PathBuf {
let path = Path::new(value);
if path.is_absolute() {
path.to_path_buf()
let normalized = brush_core::sys::fs::normalize_shell_path(Path::new(value));
if normalized.is_absolute() {
normalized.into_owned()
} else {
cwd.join(path)
cwd.join(normalized)
}
}
@@ -957,3 +957,15 @@ fn write_proc_match_help(
Ok(())
}
#[cfg(all(test, windows))]
mod tests {
use super::*;
#[test]
fn resolves_msys_drive_alias_pidfiles() {
assert_eq!(
resolve_shell_path(Path::new(r"C:\workspace"), "/c/Users/Adam/app.pid"),
PathBuf::from(r"C:\Users\Adam\app.pid"),
);
}
}