Skip to content

Commit

Permalink
fix(shim): fix .cmd shim targets
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 26, 2023
1 parent 2e9c4f5 commit 020d96c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/oro-shim-bin/src/lib.rs
Expand Up @@ -112,7 +112,7 @@ fn write_cmd_shim(
.to_string();

let target = format!(
"\"%dp0%\\{target}\" %*\r\n",
"\"%dp0%\\{target}\"",
target = from.display().to_string().replace('/', "\\")
);
if let Some(prog) = prog {
Expand All @@ -134,9 +134,9 @@ fn write_cmd_shim(
cmd.push_str(")\r\n");
cmd.push_str("\r\n");
cmd.push_str("endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & ");
cmd.push_str(&format!("\"%_prog%\" {args} \"%dp0%\\{target}\" %*\r\n",));
cmd.push_str(&format!("\"%_prog%\" {args} {target} %*\r\n",));
} else {
cmd.push_str(&format!("\"%dp0%\\{target}\" %*\r\n",));
cmd.push_str(&format!("{target} %*\r\n",));
}

std::fs::write(to.with_extension("cmd"), cmd)?;
Expand Down

0 comments on commit 020d96c

Please sign in to comment.