Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f74c08a

Browse files
johnniwintherCommit Bot
authored andcommitted
Fix yaml2json for Windows
Changed `Uri.base.resolved(...)` to `new File(...).absolute.uri` to support absolute paths on Windows. Change-Id: I9bb49a3213ac8c7ed361fc56b065753585cdc920 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228000 Reviewed-by: Jens Johansen <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
1 parent 6051eff commit f74c08a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/yaml2json.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ main(List<String> rawArguments) {
2828
stderr.writeln("Usage: yaml2json.dart input.yaml output.json [--check]");
2929
exit(1);
3030
}
31-
Uri input = Uri.base.resolve(arguments[0]);
32-
Uri output = Uri.base.resolve(arguments[1]);
31+
Uri input = new File(arguments[0]).absolute.uri;
32+
Uri output = new File(arguments[1]).absolute.uri;
3333
String inputString = arguments[0];
3434
String outputString = arguments[1];
3535
if (relative != null) {
36-
String relativeTo = Uri.base.resolve(relative).toString();
36+
String relativeTo = new File(relative).absolute.uri.toString();
3737
if (input.toString().startsWith(relativeTo)) {
3838
inputString = input.toString().substring(relativeTo.length);
3939
}

0 commit comments

Comments
 (0)