Skip to content

Commit

Permalink
dart2js: don't add a trailing slash when reading --packages
Browse files Browse the repository at this point in the history
  • Loading branch information
harryterkelsen authored and whesse committed Aug 20, 2015
1 parent 99c2010 commit 7f78948
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/compiler/lib/src/dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ String extractParameter(String argument, {bool isOptionalArgument: false}) {
return m[2];
}

String extractPath(String argument) {
String extractPath(String argument, {bool isDirectory: true}) {
String path = nativeToUriPath(extractParameter(argument));
return path.endsWith("/") ? path : "$path/";
return !path.endsWith("/") && isDirectory ? "$path/" : path;
}

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

setPackageConfig(String argument) {
packageConfig = currentDirectory.resolve(extractPath(argument));
packageConfig =
currentDirectory.resolve(extractPath(argument, isDirectory: false));
}

setOutput(Iterator<String> arguments) {
Expand Down

0 comments on commit 7f78948

Please sign in to comment.