Skip to content

Commit

Permalink
fix: ignore .fvm directory (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Limbou committed Mar 8, 2022
1 parent a4a7d07 commit 4865a91
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/cli/cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const _ignoredDirectories = {
'.plugin_symlinks',
'.dart_tool',
'build',
'.fvm',
};

bool _isPubspec(FileSystemEntity entity) {
Expand Down
25 changes: 25 additions & 0 deletions test/src/commands/packages_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,31 @@ void main() {
}),
);

test(
'ignores .fvm directory',
withRunner((commandRunner, logger, printLogs) async {
final tempDirectory = Directory.systemTemp.createTempSync();
final directory = Directory(path.join(tempDirectory.path, '.fvm'))
..createSync();
File(path.join(directory.path, 'pubspec.yaml')).writeAsStringSync(
'''
name: example
version: 0.1.0
environment:
sdk: ">=2.12.0 <3.0.0"
''',
);
final result = await commandRunner.run(
['packages', 'get', '-r', tempDirectory.path],
);
expect(result, equals(ExitCode.noInput.code));
verify(() {
logger.err(any(that: contains('Could not find a pubspec.yaml in')));
}).called(1);
}),
);

test(
'completes normally '
'when pubspec.yaml exists',
Expand Down

0 comments on commit 4865a91

Please sign in to comment.