let compile = try!(ops::compile(manifest_path, options));
let exe = &compile.binaries[0];
let exe = match util::without_prefix(&exe, config.cwd()) {
- Some(path) => if path.as_os_str() == path.file_name().unwrap() { &**exe }
- else { path }, // workaround for being able to use
- // `cargo run` from the executable path itself
- None => &**exe,
+ Some(path) if path.file_name() == Some(path.as_os_str())
+ => Path::new(".").join(path).to_path_buf(),
+ Some(path) => path.to_path_buf(),
+ None => exe.to_path_buf(),
};
let mut process = try!(compile.target_process(exe, &root))
.into_process_builder();