File tree Expand file tree Collapse file tree
create-commandkit/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11.env
2- .commandkit
2+ .commandkit
3+ compiled-commandkit.config.mjs
Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ export async function loadConfigFileFromPath(
122122
123123 const isTs = await ensureTypeScript ( target ) ;
124124
125+ let generatedFilePath : string | undefined ;
126+
125127 if ( isTs && ts ) {
126128 const { transpileModule } = ts ;
127129 const src = fs . readFileSync ( target , 'utf8' ) ;
@@ -134,12 +136,16 @@ export async function loadConfigFileFromPath(
134136 fileName : target ,
135137 } ) ;
136138
137- const nodeModulesPath = await generateTypesPackage ( ) ;
139+ await generateTypesPackage ( ) ;
140+
141+ const nodeModulesPath = process . cwd ( ) ;
138142
139143 const tmpFile = join ( nodeModulesPath , 'compiled-commandkit.config.mjs' ) ;
140144
141145 fs . writeFileSync ( tmpFile , outputText ) ;
142146
147+ generatedFilePath = tmpFile ;
148+
143149 target = tmpFile ;
144150 }
145151
@@ -150,6 +156,14 @@ export async function loadConfigFileFromPath(
150156 ( conf ) => conf . default || conf ,
151157 ) ;
152158
159+ if ( generatedFilePath ) {
160+ try {
161+ fs . unlinkSync ( generatedFilePath ) ;
162+ } catch {
163+ //
164+ }
165+ }
166+
153167 return config ;
154168}
155169
Original file line number Diff line number Diff line change 88
99# commandkit
1010.commandkit
11+ compiled-commandkit.config.mjs
1112
1213# env
1314** /* .env *
Original file line number Diff line number Diff line change 88
99# commandkit
1010.commandkit
11+ compiled-commandkit.config.mjs
1112
1213# env
1314** /* .env *
You can’t perform that action at this time.
0 commit comments