@@ -7,7 +7,7 @@ import ora from 'ora';
7
7
import logSymbols from 'log-symbols' ;
8
8
import type { Options } from '@react-email/render' ;
9
9
import normalize from 'normalize-path' ;
10
- import { closeOraOnSIGNIT } from '../../utils/close-ora-on-sigint ' ;
10
+ import { registerSpinnerAutostopping } from '../../utils/register-spinner-autostopping ' ;
11
11
import { tree } from '../utils' ;
12
12
import {
13
13
EmailsDirectory ,
@@ -49,7 +49,7 @@ export const exportTemplates = async (
49
49
let spinner : ora . Ora | undefined ;
50
50
if ( ! options . silent ) {
51
51
spinner = ora ( 'Preparing files...\n' ) . start ( ) ;
52
- closeOraOnSIGNIT ( spinner ) ;
52
+ registerSpinnerAutostopping ( spinner ) ;
53
53
}
54
54
55
55
const emailsDirectoryMetadata = await getEmailsDirectoryMetadata (
@@ -90,14 +90,7 @@ export const exportTemplates = async (
90
90
text : 'Failed to build emails' ,
91
91
} ) ;
92
92
}
93
-
94
- console . warn ( buildFailure . warnings ) ;
95
- console . error ( buildFailure . errors ) ;
96
- throw new Error (
97
- `esbuild bundling process for email templates failed:\n${ allTemplates
98
- . map ( ( p ) => `- ${ p } ` )
99
- . join ( '\n' ) } `,
100
- ) ;
93
+ process . exit ( 1 ) ;
101
94
}
102
95
103
96
if ( spinner ) {
@@ -144,7 +137,7 @@ export const exportTemplates = async (
144
137
} ) ;
145
138
}
146
139
console . error ( exception ) ;
147
- throw exception ;
140
+ process . exit ( 1 ) ;
148
141
}
149
142
}
150
143
if ( spinner ) {
@@ -178,9 +171,10 @@ export const exportTemplates = async (
178
171
text : 'Failed to copy static files' ,
179
172
} ) ;
180
173
}
181
- throw new Error (
174
+ console . error (
182
175
`Something went wrong while copying the file to ${ pathToWhereEmailMarkupShouldBeDumped } /static, ${ exception } ` ,
183
176
) ;
177
+ process . exit ( 1 ) ;
184
178
}
185
179
}
186
180
0 commit comments