Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #227 #228

Merged
merged 2 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/perseus-cli/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ macro_rules! copy_directory {
}
}
#[cfg(windows)]
if std::os::unix::fs::symlink_dir($target.join($from), $target.join($to_symlink)).is_err() {
if std::os::windows::fs::symlink_dir($target.join($from), $target.join($to_symlink)).is_err() {
// That failed, try a usual copy
if let Err(err) = fs_extra::dir::copy(
$target.join($from),
Expand Down
16 changes: 12 additions & 4 deletions packages/perseus-cli/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ impl Tools {
if let (ToolStatus::Available(wb_path), ToolStatus::Available(wo_path)) =
(&wb_status, &wo_status)
{
#[cfg(unix)]
let (wb_path, wo_path) = (wb_path.to_string(), wo_path.to_string());
#[cfg(windows)]
let (wb_path, wo_path) = (format!("& \'{}\'", wb_path), format!("& \'{}\'", wo_path));
Ok(Tools {
cargo_engine: global_opts.cargo_engine_path.clone(),
cargo_browser: global_opts.cargo_browser_path.clone(),
wasm_bindgen: wb_path.to_string(),
wasm_opt: wo_path.to_string(),
wasm_bindgen: wb_path,
wasm_opt: wo_path,
})
} else {
// We need to install some things, which may take some time
Expand All @@ -167,12 +171,16 @@ impl Tools {
// If we're here, we have the paths
succeed_spinner(&spinner, &spinner_msg);
let paths = res.unwrap();
#[cfg(unix)]
let (wb_path, wo_path) = paths;
#[cfg(windows)]
let (wb_path, wo_path) = (format!("& \'{}\'", paths.0), format!("& \'{}\'", paths.1));

Ok(Tools {
cargo_engine: global_opts.cargo_engine_path.clone(),
cargo_browser: global_opts.cargo_browser_path.clone(),
wasm_bindgen: paths.0,
wasm_opt: paths.1,
wasm_bindgen: wb_path,
wasm_opt: wo_path,
})
}
}
Expand Down