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:
@ -201,11 +201,22 @@ const getExistingStepNums = projectPath => {
|
||||
const getProjectPath = () =>
|
||||
(process.env.CALLING_DIR || process.cwd()) + path.sep;
|
||||
|
||||
const getArgValues = argv => {
|
||||
return argv.slice(2).reduce((argsObj, arg) => {
|
||||
const [argument, value] = arg.replace(/\s/g, '').split('=');
|
||||
if (!argument || !value) {
|
||||
throw `Invalid argument/value specified: ${arg}`;
|
||||
}
|
||||
return { ...argsObj, [argument]: value };
|
||||
}, {});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
createStepFile,
|
||||
getChallengeSeed,
|
||||
padWithLeadingZeros,
|
||||
reorderSteps,
|
||||
getExistingStepNums,
|
||||
getProjectPath
|
||||
getProjectPath,
|
||||
getArgValues
|
||||
};
|
||||
|
Reference in New Issue
Block a user