mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 04:43:03 -05:00
fix(generator): fix generator
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
||||
formatFiles,
|
||||
generateFiles,
|
||||
names,
|
||||
readJsonFile,
|
||||
Tree,
|
||||
updateJson,
|
||||
} from '@nx/devkit';
|
||||
@@ -48,11 +47,6 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
||||
|
||||
const difficulty = options.challengeDifficulty;
|
||||
|
||||
const challengeNumberPath = 'challenge-number.json';
|
||||
const challangeNumberJson = readJsonFile(challengeNumberPath);
|
||||
const challengeNumber = challangeNumberJson.total + 1;
|
||||
const order = challangeNumberJson[difficulty] + 1;
|
||||
|
||||
await applicationGenerator(tree, {
|
||||
...options,
|
||||
directory: `apps/${options.category}`,
|
||||
@@ -69,6 +63,13 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
||||
skipTests: true,
|
||||
});
|
||||
|
||||
const challengeNumberPath = 'challenge-number.json';
|
||||
const challangeNumberJson = JSON.parse(
|
||||
tree.read(challengeNumberPath).toString()
|
||||
);
|
||||
const challengeNumber = challangeNumberJson.total + 1;
|
||||
const order = challangeNumberJson[difficulty] + 1;
|
||||
|
||||
generateFiles(tree, join(__dirname, 'files', 'app'), appDirectory, {
|
||||
tmpl: '',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user