Skip to content

Commit 88431e3

Browse files
committed
fix(create): Allow template setup scripts to return promises.
1 parent d4cb34d commit 88431e3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

β€Žsrc/commands/create.tsβ€Ž

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ interface ICreateCommand {
3232

3333
interface ICreator {
3434
location: string;
35-
module?: (options: { where: string }) => void | { repository: string };
35+
module?:
36+
| ((options: { where: string }) => Promise<any> | void)
37+
| { repository: string };
3638
package?: {};
3739
}
3840

@@ -208,7 +210,7 @@ const create = async (
208210
if (starter.entry) {
209211
log.write(` πŸƒ Running setup script`);
210212

211-
starter.entry({ inquirer, render, fs, rimraf, where });
213+
await starter.entry({ inquirer, render, fs, rimraf, where });
212214

213215
log.write(`βœ” πŸƒ Ran setup script`);
214216
log.clear();
@@ -283,7 +285,7 @@ const create = async (
283285
log.write(` πŸ‘· Running configuration`);
284286

285287
if (typeof creator.module === 'function') {
286-
creator.module({
288+
await creator.module({
287289
where,
288290
});
289291
}
@@ -299,7 +301,7 @@ const create = async (
299301
}
300302
}
301303

302-
log.write(`βœ” πŸ‘· Running configuration`);
304+
log.write(`βœ” πŸ‘· Ran configuration`);
303305
log.clear();
304306

305307
log.write(`πŸŽ‰ Done!`);

0 commit comments

Comments
Β (0)