mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
comment a string hack on windows
This commit is contained in:
parent
d3d9320eb9
commit
9d7e1acb73
1 changed files with 7 additions and 0 deletions
|
@ -107,9 +107,16 @@ pub fn get_lib_path() -> Option<PathBuf> {
|
|||
let exe_relative_str_path_opt = std::env::current_exe().ok();
|
||||
|
||||
if let Some(exe_relative_str_path) = exe_relative_str_path_opt {
|
||||
// on windows, the current exe path is prefixed with `\\?\`, the "verbatim" prefix
|
||||
// such a path does not works as an argument to `zig` and other command line tools,
|
||||
// and there seems to be no good way to strip it. So we resort to some string manipulation
|
||||
#[cfg(windows)]
|
||||
let strip_windows_prefix = exe_relative_str_path.display().to_string();
|
||||
|
||||
#[cfg(windows)]
|
||||
let exe_relative_str_path =
|
||||
std::path::Path::new(strip_windows_prefix.trim_start_matches(r"\\?\"));
|
||||
|
||||
let mut curr_parent_opt = exe_relative_str_path.parent();
|
||||
|
||||
// this differs for regular build and nix releases, so we check in multiple spots.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue