Skip to content

Commit c7a8b30

Browse files
committed
fix the tests for windows
1 parent a029c7a commit c7a8b30

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/acceptance/hooks.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ const PROJECT_PACKAGE_JSON: &str = r#"
2222
}
2323
}"#;
2424

25+
// scripts that read stdin, and write it to file 'events.json'
26+
27+
#[cfg(windows)]
28+
const EVENTS_EXECUTABLE: &str = r#"@echo off
29+
setlocal
30+
break >events.json
31+
for /F "tokens=*" %%line in ('more') do (
32+
echo %%line >>events.json
33+
)"#;
34+
35+
#[cfg(unix)]
2536
const EVENTS_EXECUTABLE: &str = r#"#!/bin/bash
2637
# read Volta events from stdin, and write to events.json
2738
# (but first clear it out)

tests/acceptance/merged_platform.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ const PLATFORM_WITH_YARN: &str = r#"{
5151
"yarn": "1.7.71"
5252
}"#;
5353

54+
// scripts that read stdin, and write it to file 'events.json'
55+
56+
#[cfg(windows)]
57+
const EVENTS_EXECUTABLE: &str = r#"@echo off
58+
setlocal
59+
break >events.json
60+
for /F "tokens=*" %%line in ('more') do (
61+
echo %%line >>events.json
62+
)"#;
63+
64+
#[cfg(unix)]
5465
const EVENTS_EXECUTABLE: &str = r#"#!/bin/bash
5566
# read Volta events from stdin, and write to events.json
5667
# (but first clear it out)

0 commit comments

Comments
 (0)