Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(shorebird_cli): remove upgrade suggestion from shorebird init #728

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/shorebird_cli/lib/src/commands/init_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:shorebird_cli/src/shorebird_environment.dart';
import 'package:shorebird_cli/src/shorebird_flavor_mixin.dart';
import 'package:shorebird_cli/src/shorebird_java_mixin.dart';
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';

/// {@template init_command}
///
Expand Down Expand Up @@ -103,11 +102,6 @@ If you want to reinitialize Shorebird, please run "shorebird init --force".''');
} else {
appId = (await createApp(appName: displayName)).id;
}
} on CodePushForbiddenException {
logger.err('''
A paid account is required to create apps.
To upgrade, run ${lightCyan.wrap('shorebird account upgrade')}.''');
return ExitCode.software.code;
} catch (error) {
logger.err('$error');
return ExitCode.software.code;
Expand Down
30 changes: 0 additions & 30 deletions packages/shorebird_cli/test/src/commands/init_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,36 +401,6 @@ If you want to reinitialize Shorebird, please run "shorebird init --force".''',
expect(exitCode, ExitCode.software.code);
});

test(
'''exits with code 70 and prints error if user does not have a paid account''',
() async {
final tempDir = Directory.systemTemp.createTempSync();
File(
p.join(tempDir.path, 'pubspec.yaml'),
).writeAsStringSync(pubspecYamlContent);
when(
() => codePushClient.createApp(displayName: any(named: 'displayName')),
).thenThrow(CodePushForbiddenException(message: 'oh no'));

final result = await IOOverrides.runZoned(
() => runWithOverrides(command.run),
getCurrentDirectory: () => tempDir,
);

expect(result, ExitCode.software.code);

verify(
() => logger.err(
any(
that: stringContainsInOrder([
'A paid account is required to create apps',
'shorebird account upgrade',
]),
),
),
);
});

test('creates shorebird.yaml for an app without flavors', () async {
final tempDir = Directory.systemTemp.createTempSync();
File(
Expand Down