Skip to content

Commit

Permalink
Fix always fails to find "pubspec.lock" on Windows
Browse files Browse the repository at this point in the history
Use `Directory.current.path` instead of environmental variable `PWD`
to support non-POSIX shell.
  • Loading branch information
yukidaruma committed Jun 27, 2020
1 parent 8d152ad commit 19b6b35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ main(List<String> arguments) async {
/// acquire all the names of the using library.
Iterable<dynamic> findPluginNames() {
Map environmentVars = Platform.environment;
String path = '${environmentVars["PWD"]}/pubspec.lock';
String path = '${Directory.current.path}/pubspec.lock';

if (FileSystemEntity.typeSync(path) == FileSystemEntityType.notFound) {
throw AssertionError(
Expand Down

0 comments on commit 19b6b35

Please sign in to comment.