Skip to content

Commit a0682e0

Browse files
author
Vieltojarvi
committed
added spinner and success message to seed command
1 parent 20cee9f commit a0682e0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/cli/src/commands/sandbox/sandbox-seed/sandbox_seed_command.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ void describe('sandbox seed command', () => {
107107
const output = await commandRunner.runCommand('sandbox seed');
108108

109109
assert.ok(output !== undefined);
110+
assert.strictEqual(
111+
output.trimEnd(),
112+
'✅ seed has successfully completed'
113+
);
110114
assert.strictEqual(mockHandleProfile.mock.callCount(), 1);
111115
});
112116
});

packages/cli/src/commands/sandbox/sandbox-seed/sandbox_seed_command.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { execa } from 'execa';
55
import { SandboxBackendIdResolver } from '../sandbox_id_resolver.js';
66
import { AmplifyUserError } from '@aws-amplify/platform-core';
77
import { SandboxCommandGlobalOptions } from '../option_types.js';
8+
import { printer } from '@aws-amplify/cli-core';
89

910
/**
1011
* Command that runs seed in sandbox environment
@@ -35,6 +36,7 @@ export class SandboxSeedCommand implements CommandModule<object> {
3536
* @inheritDoc
3637
*/
3738
handler = async (): Promise<void> => {
39+
printer.startSpinner('runSeedSpinner', '');
3840
const backendID = await this.backendIDResolver.resolve();
3941
const seedPath = path.join('amplify', 'seed', 'seed.ts');
4042
await execa('tsx', [seedPath], {
@@ -44,6 +46,8 @@ export class SandboxSeedCommand implements CommandModule<object> {
4446
AMPLIFY_BACKEND_IDENTIFIER: JSON.stringify(backendID),
4547
},
4648
});
49+
printer.stopSpinner('runSeedSpinner');
50+
printer.print('✅ seed has successfully completed');
4751
};
4852

4953
/**

0 commit comments

Comments
 (0)