We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
install::sanitize_sh
1 parent ae3703c commit fc1d2e5Copy full SHA for fc1d2e5
src/bootstrap/src/core/build_steps/install.rs
@@ -23,7 +23,12 @@ const SHELL: &str = "sh";
23
/// characters and on `C:\` paths, so normalize both of them away.
24
fn sanitize_sh(path: &Path) -> String {
25
let path = path.to_str().unwrap().replace('\\', "/");
26
- return change_drive(unc_to_lfs(&path)).unwrap_or(path);
+ return if is_cygwin() { path } else { change_drive(unc_to_lfs(&path)).unwrap_or(path) };
27
+
28
+ fn is_cygwin() -> bool {
29
+ // ref. https://cygwin.com/pipermail/cygwin/2022-February/250802.html
30
+ env::var("OSTYPE").map_or(false, |v| v.to_lowercase().contains("cygwin"))
31
+ }
32
33
fn unc_to_lfs(s: &str) -> &str {
34
s.strip_prefix("//?/").unwrap_or(s)
0 commit comments