-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.Use area-dart-cli for issues related to the 'dart' command like tool.dart-cli-runIssues related to 'dart run'Issues related to 'dart run'
Description
Consider:
# bin/my_app.dart
void main() {
const foo = const String.fromEnvironment('foo', defaultValue: 'no foo');
print(foo);
}Passing a full script path works as expected
$ dart -Dfoo=foo run bin/my_app.dart
foo
$ dart -Dfoo=bar run bin/my_app.dart
bar
$ dart run -Dfoo=foo bin/my_app.dart
foo
$ dart run -Dfoo=bar bin/my_app.dart
bar
However, using just the name instead of the full path uses caching, and ignores the defines:
$ dart -Dfoo=foo run my_app
foo
$ dart -Dfoo=bar run my_app
foo
srawlins
Metadata
Metadata
Assignees
Labels
area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.Use area-dart-cli for issues related to the 'dart' command like tool.dart-cli-runIssues related to 'dart run'Issues related to 'dart run'