Skip to content

Commit 4865a91

Browse files
authored
fix: ignore .fvm directory (#307)
1 parent a4a7d07 commit 4865a91

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/src/cli/cli.dart

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const _ignoredDirectories = {
6565
'.plugin_symlinks',
6666
'.dart_tool',
6767
'build',
68+
'.fvm',
6869
};
6970

7071
bool _isPubspec(FileSystemEntity entity) {

test/src/commands/packages_test.dart

+25
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,31 @@ void main() {
120120
}),
121121
);
122122

123+
test(
124+
'ignores .fvm directory',
125+
withRunner((commandRunner, logger, printLogs) async {
126+
final tempDirectory = Directory.systemTemp.createTempSync();
127+
final directory = Directory(path.join(tempDirectory.path, '.fvm'))
128+
..createSync();
129+
File(path.join(directory.path, 'pubspec.yaml')).writeAsStringSync(
130+
'''
131+
name: example
132+
version: 0.1.0
133+
134+
environment:
135+
sdk: ">=2.12.0 <3.0.0"
136+
''',
137+
);
138+
final result = await commandRunner.run(
139+
['packages', 'get', '-r', tempDirectory.path],
140+
);
141+
expect(result, equals(ExitCode.noInput.code));
142+
verify(() {
143+
logger.err(any(that: contains('Could not find a pubspec.yaml in')));
144+
}).called(1);
145+
}),
146+
);
147+
123148
test(
124149
'completes normally '
125150
'when pubspec.yaml exists',

0 commit comments

Comments
 (0)