Skip to content

Commit 7f78948

Browse files
harryterkelsenwhesse
authored andcommitted
dart2js: don't add a trailing slash when reading --packages
BUG= [email protected] Review URL: https://codereview.chromium.org//1290903002.
1 parent 99c2010 commit 7f78948

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/compiler/lib/src/dart2js.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ String extractParameter(String argument, {bool isOptionalArgument: false}) {
6666
return m[2];
6767
}
6868

69-
String extractPath(String argument) {
69+
String extractPath(String argument, {bool isDirectory: true}) {
7070
String path = nativeToUriPath(extractParameter(argument));
71-
return path.endsWith("/") ? path : "$path/";
71+
return !path.endsWith("/") && isDirectory ? "$path/" : path;
7272
}
7373

7474
void parseCommandLine(List<OptionHandler> handlers, List<String> argv) {
@@ -143,7 +143,8 @@ Future<api.CompilationResult> compile(List<String> argv) {
143143
}
144144

145145
setPackageConfig(String argument) {
146-
packageConfig = currentDirectory.resolve(extractPath(argument));
146+
packageConfig =
147+
currentDirectory.resolve(extractPath(argument, isDirectory: false));
147148
}
148149

149150
setOutput(Iterator<String> arguments) {

0 commit comments

Comments
 (0)