Skip to content

Commit

Permalink
fix: When copying and creating a file with the same name, an error oc…
Browse files Browse the repository at this point in the history
…curs when the file already exists.

Signed-off-by: The1111mp <[email protected]>
  • Loading branch information
1111mp committed Nov 17, 2023
1 parent ed23cbb commit 54cd957
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/run/npm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ fn link_package(name: &String) {
let cmd = name.clone() + ".cmd";
cmd_alias.push(cmd);

let options = CopyOptions::new(); //Initialize default values for CopyOptions
let mut options = CopyOptions::new(); //Initialize default values for CopyOptions
options.skip_exist = true; // Skip existing files if true (default: false).
copy(&exe_source, &exe_alias, &options).unwrap();
copy(&cmd_source, &cmd_alias, &options).unwrap();
}
Expand Down

0 comments on commit 54cd957

Please sign in to comment.