File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1114,15 +1114,25 @@ impl Benchmark {
1114
1114
self . config . supports_stable
1115
1115
}
1116
1116
1117
+ #[ cfg( windows) ]
1118
+ fn copy ( from : & Path , to : & Path ) -> anyhow:: Result < ( ) > {
1119
+ robocopy ( from, to, & [ ] )
1120
+ }
1121
+
1122
+ #[ cfg( unix) ]
1123
+ fn copy ( from : & Path , to : & Path ) -> anyhow:: Result < ( ) > {
1124
+ let mut cmd = Command :: new ( "cp" ) ;
1125
+ cmd. arg ( "-pLR" ) . arg ( from) . arg ( to) ;
1126
+ command_output ( & mut cmd)
1127
+ }
1128
+
1117
1129
fn make_temp_dir ( & self , base : & Path ) -> anyhow:: Result < TempDir > {
1118
1130
// Appending `.` means we copy just the contents of `base` into
1119
1131
// `tmp_dir`, rather than `base` itself.
1120
1132
let mut base_dot = base. to_path_buf ( ) ;
1121
1133
base_dot. push ( "." ) ;
1122
1134
let tmp_dir = TempDir :: new ( ) ?;
1123
- let mut cmd = Command :: new ( "cp" ) ;
1124
- cmd. arg ( "-pLR" ) . arg ( base_dot) . arg ( tmp_dir. path ( ) ) ;
1125
- command_output ( & mut cmd) . with_context ( || format ! ( "copying {} to tmp dir" , self . name) ) ?;
1135
+ Self :: copy ( & base_dot, tmp_dir. path ( ) ) . with_context ( || format ! ( "copying {} to tmp dir" , self . name) ) ?;
1126
1136
Ok ( tmp_dir)
1127
1137
}
1128
1138
You can’t perform that action at this time.
0 commit comments