File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed
packages/create-email/src Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -66,19 +66,24 @@ const init = async (name, { tag }) => {
66
66
'./package.json' ,
67
67
) ;
68
68
const templatePackageJson = fse . readFileSync ( templatePackageJsonPath , 'utf8' ) ;
69
- fse . writeFileSync (
70
- templatePackageJsonPath ,
71
- templatePackageJson
72
- . replace (
73
- 'INSERT_COMPONENTS_VERSION' ,
74
- await getLatestVersionOfTag ( '@react-email/components' , tag ) ,
75
- )
76
- . replace (
77
- 'INSERT_REACT_EMAIL_VERSION' ,
78
- await getLatestVersionOfTag ( 'react-email' , tag ) ,
79
- ) ,
80
- 'utf8' ,
81
- ) ;
69
+ try {
70
+ fse . writeFileSync (
71
+ templatePackageJsonPath ,
72
+ templatePackageJson
73
+ . replace (
74
+ 'INSERT_COMPONENTS_VERSION' ,
75
+ await getLatestVersionOfTag ( '@react-email/components' , tag ) ,
76
+ )
77
+ . replace (
78
+ 'INSERT_REACT_EMAIL_VERSION' ,
79
+ await getLatestVersionOfTag ( 'react-email' , tag ) ,
80
+ ) ,
81
+ 'utf8' ,
82
+ ) ;
83
+ } catch ( exception ) {
84
+ fse . removeSync ( resolvedProjectPath ) ;
85
+ throw exception ;
86
+ }
82
87
83
88
spinner . stopAndPersist ( {
84
89
symbol : logSymbols . success ,
You can’t perform that action at this time.
0 commit comments