@@ -5,7 +5,7 @@ import { execa } from 'execa';
5
5
import { SandboxBackendIdResolver } from '../sandbox_id_resolver.js' ;
6
6
import { AmplifyUserError } from '@aws-amplify/platform-core' ;
7
7
import { SandboxCommandGlobalOptions } from '../option_types.js' ;
8
- import { printer } from '@aws-amplify/cli-core' ;
8
+ import { format , printer } from '@aws-amplify/cli-core' ;
9
9
10
10
/**
11
11
* Command that runs seed in sandbox environment
@@ -39,15 +39,21 @@ export class SandboxSeedCommand implements CommandModule<object> {
39
39
printer . startSpinner ( 'runSeedSpinner' , '' ) ;
40
40
const backendID = await this . backendIDResolver . resolve ( ) ;
41
41
const seedPath = path . join ( 'amplify' , 'seed' , 'seed.ts' ) ;
42
- await execa ( 'tsx' , [ seedPath ] , {
43
- cwd : process . cwd ( ) ,
44
- stdio : 'inherit' ,
45
- env : {
46
- AMPLIFY_BACKEND_IDENTIFIER : JSON . stringify ( backendID ) ,
47
- } ,
48
- } ) ;
42
+ try {
43
+ await execa ( 'tsx' , [ seedPath ] , {
44
+ cwd : process . cwd ( ) ,
45
+ stdio : 'inherit' ,
46
+ env : {
47
+ AMPLIFY_BACKEND_IDENTIFIER : JSON . stringify ( backendID ) ,
48
+ } ,
49
+ } ) ;
50
+ } catch ( err ) {
51
+ printer . stopSpinner ( 'runSeedSpinner' ) ;
52
+ throw err ;
53
+ }
49
54
printer . stopSpinner ( 'runSeedSpinner' ) ;
50
- printer . print ( '✅ seed has successfully completed' ) ;
55
+ printer . printNewLine ( ) ;
56
+ printer . print ( `${ format . success ( '✔' ) } seed has successfully completed` ) ;
51
57
} ;
52
58
53
59
/**
0 commit comments