Skip to content

Commit 361bdf0

Browse files
committed
feat(create): Allow proxy npm packages to git templates.
1 parent 073c870 commit 361bdf0

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

src/commands/create.ts

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

3333
interface ICreator {
3434
location: string;
35-
module?: (options: { where: string }) => void;
35+
module?: (options: { where: string }) => void | { repository: string };
3636
package?: {};
3737
}
3838

@@ -76,8 +76,8 @@ const pacman: IPacMan = {
7676
},
7777
};
7878

79-
export default async (
80-
create: 'create',
79+
const create = async (
80+
subcommand: 'create',
8181
name: string,
8282
where: string,
8383
command: ICreateCommand,
@@ -282,11 +282,29 @@ export default async (
282282

283283
log.write(` 👷 Running configuration`);
284284

285-
creator.module!({
286-
where,
287-
});
285+
if (typeof creator.module === 'function') {
286+
creator.module({
287+
where,
288+
});
289+
}
290+
291+
if (typeof creator.module === 'object') {
292+
if ((creator.module as any).repository) {
293+
await create(
294+
subcommand,
295+
(creator.module as any).repository,
296+
where,
297+
command,
298+
);
299+
}
300+
}
288301

289302
log.write(`✔ 👷 Running configuration`);
290303
log.clear();
304+
305+
log.write(`🎉 Done!`);
306+
log.clear();
291307
}
292308
};
309+
310+
export default create;

0 commit comments

Comments
 (0)