mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-30 16:40:18 +00:00
Fixes #568
This commit is contained in:
1 parent
af2f0ace22
commit
f00acf962e
2 files changed
+8
-2
No files matched your search
@@ -130,7 +130,13 @@ impl<'a> Executor for ShellExecutor<'a> {
|
||||
) -> Result<(TimingResult, ExitStatus)> {
|
||||
let mut command_builder = self.shell.command();
|
||||
command_builder
|
||||
.arg(if cfg!(windows) { "/C" } else { "-c" })
|
||||
.arg(
|
||||
if cfg!(windows) && *self.shell == Shell::Default("cmd.exe") {
|
||||
"/C"
|
||||
} else {
|
||||
"-c"
|
||||
},
|
||||
)
|
||||
.arg(command.get_command_line());
|
||||
|
||||
let mut result = run_command_and_measure_common(
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ pub const DEFAULT_SHELL: &str = "sh";
|
||||
pub const DEFAULT_SHELL: &str = "cmd.exe";
|
||||
|
||||
/// Shell to use for executing benchmarked commands
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Shell {
|
||||
/// Default shell command
|
||||
Default(&'static str),
|
||||
|
||||
Reference in new issue
Block a user