File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -477,10 +477,11 @@ class Config {
477
477
required core.bool resolveUri,
478
478
required Uri ? baseUri,
479
479
}) {
480
+ final uri = Source .fileSystemPathToUri (path);
480
481
if (resolveUri && baseUri != null ) {
481
- return baseUri.resolve (path );
482
+ return baseUri.resolveUri (uri );
482
483
}
483
- return Source . fileSystemPathToUri (path) ;
484
+ return uri ;
484
485
}
485
486
486
487
/// Lookup a list of paths in this config.
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ @TestOn ('windows' )
6
+ library ;
7
+
8
+ import 'package:cli_config/cli_config.dart' ;
9
+ import 'package:test/test.dart' ;
10
+
11
+ void main () {
12
+ test ('path resolving windows' , () {
13
+ const path = 'C:\\ foo\\ bar\\ ' ;
14
+ final workingDirectory = Uri .parse ('file:///C:/baz/baf/' );
15
+
16
+ final config = Config (
17
+ commandLineDefines: ['key=$path ' ],
18
+ workingDirectory: workingDirectory,
19
+ );
20
+ final value = config.path ('key' , resolveUri: true );
21
+ expect (value.toFilePath (), path);
22
+ });
23
+ }
You can’t perform that action at this time.
0 commit comments