mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 04:43:03 -05:00
feat: add challenge number to generator
This commit is contained in:
@@ -38,7 +38,8 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
||||
const challengeNumberJson = JSON.parse(
|
||||
tree.read(challengeNumberPath).toString(),
|
||||
);
|
||||
const challengeNumber = challengeNumberJson.total + 1;
|
||||
const challengeNumber =
|
||||
options.challengeNumber ?? challengeNumberJson.total + 1;
|
||||
const difficulty = options.challengeDifficulty;
|
||||
|
||||
const name = options.title.toLowerCase().split(' ').join('-');
|
||||
|
||||
@@ -6,4 +6,5 @@ export interface Schema {
|
||||
addTest?: boolean;
|
||||
skipPackageJson?: boolean;
|
||||
rootProject?: boolean;
|
||||
challengeNumber?: number;
|
||||
}
|
||||
|
||||
@@ -95,6 +95,10 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"challengeNumber": {
|
||||
"description": "Specify a challenge number (If you don't, the challenge number will be set automatically)",
|
||||
"type": "number"
|
||||
},
|
||||
"addTest": {
|
||||
"description": "add spec files.",
|
||||
"type": "boolean",
|
||||
|
||||
Reference in New Issue
Block a user