feat(learn): Create tool to delete an existing project step in project-based curriculum (#39786)
* feat: created tool to delete step * docs: update README.md with delete-step instructions Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@ -4,22 +4,15 @@ const {
|
||||
getChallengeSeed,
|
||||
padWithLeadingZeros,
|
||||
getExistingStepNums,
|
||||
getProjectPath
|
||||
getProjectPath,
|
||||
getArgValues
|
||||
} = require('./utils');
|
||||
|
||||
const allStepsExist = (steps, stepsToFind) =>
|
||||
stepsToFind.every(num => steps.includes(num));
|
||||
|
||||
const projectPath = getProjectPath();
|
||||
const argValuePairs = process.argv.slice(2);
|
||||
|
||||
const args = argValuePairs.reduce((argsObj, arg) => {
|
||||
const [argument, value] = arg.replace(/\s/g, '').split('=');
|
||||
if (!argument || !value) {
|
||||
throw `Invalid argument/value specified: ${arg}`;
|
||||
}
|
||||
return { ...argsObj, [argument]: value };
|
||||
}, {});
|
||||
const args = getArgValues(process.argv);
|
||||
|
||||
let { start, end } = args;
|
||||
start = parseInt(start, 10);
|
||||
|
Reference in New Issue
Block a user