mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-03 09:23:00 +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)> {
|
) -> Result<(TimingResult, ExitStatus)> {
|
||||||
let mut command_builder = self.shell.command();
|
let mut command_builder = self.shell.command();
|
||||||
command_builder
|
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());
|
.arg(command.get_command_line());
|
||||||
|
|
||||||
let mut result = run_command_and_measure_common(
|
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";
|
pub const DEFAULT_SHELL: &str = "cmd.exe";
|
||||||
|
|
||||||
/// Shell to use for executing benchmarked commands
|
/// Shell to use for executing benchmarked commands
|
||||||
#[derive(Debug)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Shell {
|
pub enum Shell {
|
||||||
/// Default shell command
|
/// Default shell command
|
||||||
Default(&'static str),
|
Default(&'static str),
|
||||||
|
|||||||
Reference in new issue
Block a user