fix(shorebird_cli): improve shorebird init missing pubspec.yaml error (#169)

This commit is contained in:
Felix Angelov
2023-03-24 17:15:29 -05:00
committed by GitHub
parent 9873dfedbd
commit d2bfda82ef
2 changed files with 12 additions and 2 deletions
@@ -30,7 +30,10 @@ class InitCommand extends ShorebirdCommand
final progress = logger.progress('Initializing Shorebird');
try {
if (!hasPubspecYaml) {
progress.fail('Could not find a "pubspec.yaml".');
progress.fail('''
Could not find a "pubspec.yaml".
Please make sure you are running "shorebird init" from the root of your Flutter project.
''');
return ExitCode.noInput.code;
}
} catch (error) {
@@ -72,7 +72,14 @@ environment:
command.run,
getCurrentDirectory: () => tempDir,
);
verify(() => progress.fail('Could not find a "pubspec.yaml".')).called(1);
verify(
() => progress.fail(
'''
Could not find a "pubspec.yaml".
Please make sure you are running "shorebird init" from the root of your Flutter project.
''',
),
).called(1);
expect(exitCode, ExitCode.noInput.code);
});