Skip to content

Commit d86809d

Browse files
committed
Fix stub path
1 parent 9933f4e commit d86809d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

casr/src/stub.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
use std::env;
2+
use std::path::PathBuf;
23
use std::process::Command;
34

45
pub fn stub(subcommand: &str) {
56
// Get all command-line arguments
67
let args: Vec<String> = env::args().collect();
8+
let casr = &args[0];
79
let args = &args[1..];
810

11+
// Get casr path
12+
let mut casr = PathBuf::from(casr);
13+
casr.set_file_name("casr");
14+
let casr = casr.to_string_lossy().into_owned();
15+
916
// Execute casr
10-
let result = Command::new("casr").arg(subcommand).args(args).status();
17+
let result = Command::new(casr).arg(subcommand).args(args).status();
1118

1219
// Handle execution result
1320
match result {

0 commit comments

Comments
 (0)