fix: case-sensitiveness check

This commit is contained in:
Shunsuke Shibayama 2023-07-03 23:25:40 +09:00
parent cac45a41e2
commit ad96859d71
3 changed files with 18 additions and 1 deletions

View file

@ -15,5 +15,18 @@ fn main() -> std::io::Result<()> {
println!("cargo:rustc-env=GIT_HASH_SHORT={git_hash_short}");
println!("cargo:rustc-env=BUILD_DATE={now}");
println!("cargo:rustc-env=CARGO_ERG_PATH={}", erg_path.display());
let case_sensitive = if cfg!(windows) {
false
} else if cfg!(target_os = "macos") {
let command = Command::new("diskutil")
.args(["info", "/"])
.output()
.expect("failed to get the file system type");
let output = String::from_utf8_lossy(&command.stdout);
output.contains("Case-sensitive")
} else {
true
};
println!("cargo:rustc-env=CASE_SENSITIVE={}", case_sensitive);
Ok(())
}