mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
fix(generator): fix generator
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
|||||||
formatFiles,
|
formatFiles,
|
||||||
generateFiles,
|
generateFiles,
|
||||||
names,
|
names,
|
||||||
readJsonFile,
|
|
||||||
Tree,
|
Tree,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nx/devkit';
|
} from '@nx/devkit';
|
||||||
@@ -48,11 +47,6 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
|||||||
|
|
||||||
const difficulty = options.challengeDifficulty;
|
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, {
|
await applicationGenerator(tree, {
|
||||||
...options,
|
...options,
|
||||||
directory: `apps/${options.category}`,
|
directory: `apps/${options.category}`,
|
||||||
@@ -69,6 +63,13 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
|||||||
skipTests: true,
|
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, {
|
generateFiles(tree, join(__dirname, 'files', 'app'), appDirectory, {
|
||||||
tmpl: '',
|
tmpl: '',
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user