fix(shorebird_cli): improve shorebird init missing pubspec.yaml error (#169)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user