Skip to content

Commit

Permalink
chore(shorebird_cli): remove upgrade suggestion from shorebird init (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman authored Jun 29, 2023
1 parent b44da55 commit 08dff59
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
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

0 comments on commit 08dff59

Please sign in to comment.