Skip to content

Commit

Permalink
Support systems where %LocalAppData" contains a space
Browse files Browse the repository at this point in the history
This can happen when the user's full name is used at %USERPROFILE%.

Fixes: nullpo-head#72
  • Loading branch information
Antony Male committed Feb 14, 2023
1 parent c3181f4 commit 26bec2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distrod/distrod_wsl_launcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ fn register_distribution<P: AsRef<Path>>(distro_name: &str, tar_gz_filename: P)
.arg("wsl")
.arg("--import")
.arg(distro_name)
.arg(format!("%LocalAppData%\\{}", distro_name))
.arg(format!("\"%LocalAppData%\\{}\"", distro_name))
.arg(tar_gz_filename.as_ref());
let mut child = cmd
.spawn()
Expand All @@ -305,7 +305,7 @@ fn register_distribution<P: AsRef<Path>>(distro_name: &str, tar_gz_filename: P)
bail!(
"Failed: cmd.exe /C wsl --import {} {} {:#?}",
distro_name,
format!("%LocalAppData%\\{}", distro_name),
format!("\"%LocalAppData%\\{}\"", distro_name),
tar_gz_filename.as_ref()
);
}
Expand Down

0 comments on commit 26bec2c

Please sign in to comment.