@@ -79,46 +79,38 @@ const init = async (name, { tag }) => {
79
79
fse . copySync ( templatePath , resolvedProjectPath , {
80
80
recursive : true ,
81
81
} ) ;
82
- try {
83
- const templatePackageJsonPath = path . resolve (
84
- resolvedProjectPath ,
85
- './package.json' ,
86
- ) ;
87
- const templatePackageJson = fse . readFileSync (
88
- templatePackageJsonPath ,
89
- 'utf8' ,
90
- ) ;
91
- fse . writeFileSync (
92
- templatePackageJsonPath ,
93
- templatePackageJson
94
- . replace (
95
- 'INSERT_COMPONENTS_VERSION' ,
96
- await getLatestVersionOfTag ( '@react-email/components' , tag ) ,
97
- )
98
- . replace (
99
- 'INSERT_REACT_EMAIL_VERSION' ,
100
- await getLatestVersionOfTag ( 'react-email' , tag ) ,
101
- ) ,
102
- 'utf8' ,
103
- ) ;
82
+ const templatePackageJsonPath = path . resolve (
83
+ resolvedProjectPath ,
84
+ './package.json' ,
85
+ ) ;
86
+ const templatePackageJson = fse . readFileSync ( templatePackageJsonPath , 'utf8' ) ;
87
+ fse . writeFileSync (
88
+ templatePackageJsonPath ,
89
+ templatePackageJson
90
+ . replace (
91
+ 'INSERT_COMPONENTS_VERSION' ,
92
+ await getLatestVersionOfTag ( '@react-email/components' , tag ) ,
93
+ )
94
+ . replace (
95
+ 'INSERT_REACT_EMAIL_VERSION' ,
96
+ await getLatestVersionOfTag ( 'react-email' , tag ) ,
97
+ ) ,
98
+ 'utf8' ,
99
+ ) ;
104
100
105
- spinner . stopAndPersist ( {
106
- symbol : logSymbols . success ,
107
- text : 'React Email Starter files ready' ,
108
- } ) ;
109
-
110
- // eslint-disable-next-line no-console
111
- console . info (
112
- await tree ( resolvedProjectPath , 4 , ( dirent ) => {
113
- return ! path
114
- . join ( dirent . parentPath , dirent . name )
115
- . includes ( 'node_modules' ) ;
116
- } ) ,
117
- ) ;
118
- } catch ( exception ) {
119
- fse . removeSync ( resolvedProjectPath ) ;
120
- throw exception ;
121
- }
101
+ spinner . stopAndPersist ( {
102
+ symbol : logSymbols . success ,
103
+ text : 'React Email Starter files ready' ,
104
+ } ) ;
105
+
106
+ // eslint-disable-next-line no-console
107
+ console . info (
108
+ await tree ( resolvedProjectPath , 4 , ( dirent ) => {
109
+ return ! path
110
+ . join ( dirent . parentPath , dirent . name )
111
+ . includes ( 'node_modules' ) ;
112
+ } ) ,
113
+ ) ;
122
114
} ;
123
115
124
116
new Command ( )
0 commit comments