File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
create-commandkit/templates Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
1
.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(
122
122
123
123
const isTs = await ensureTypeScript ( target ) ;
124
124
125
+ let generatedFilePath : string | undefined ;
126
+
125
127
if ( isTs && ts ) {
126
128
const { transpileModule } = ts ;
127
129
const src = fs . readFileSync ( target , 'utf8' ) ;
@@ -134,12 +136,16 @@ export async function loadConfigFileFromPath(
134
136
fileName : target ,
135
137
} ) ;
136
138
137
- const nodeModulesPath = await generateTypesPackage ( ) ;
139
+ await generateTypesPackage ( ) ;
140
+
141
+ const nodeModulesPath = process . cwd ( ) ;
138
142
139
143
const tmpFile = join ( nodeModulesPath , 'compiled-commandkit.config.mjs' ) ;
140
144
141
145
fs . writeFileSync ( tmpFile , outputText ) ;
142
146
147
+ generatedFilePath = tmpFile ;
148
+
143
149
target = tmpFile ;
144
150
}
145
151
@@ -150,6 +156,14 @@ export async function loadConfigFileFromPath(
150
156
( conf ) => conf . default || conf ,
151
157
) ;
152
158
159
+ if ( generatedFilePath ) {
160
+ try {
161
+ fs . unlinkSync ( generatedFilePath ) ;
162
+ } catch {
163
+ //
164
+ }
165
+ }
166
+
153
167
return config ;
154
168
}
155
169
Original file line number Diff line number Diff line change 8
8
9
9
# commandkit
10
10
.commandkit
11
+ compiled-commandkit.config.mjs
11
12
12
13
# env
13
14
** /* .env *
Original file line number Diff line number Diff line change 8
8
9
9
# commandkit
10
10
.commandkit
11
+ compiled-commandkit.config.mjs
11
12
12
13
# env
13
14
** /* .env *
You can’t perform that action at this time.
0 commit comments