-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor CLI #48
Refactor CLI #48
Conversation
@@ -2,6 +2,7 @@ import {promises as fs} from 'fs'; | |||
import generateAssetDirectories from '../helpers/generateAssetDirectories'; | |||
|
|||
export default async (args) => { | |||
console.log('Initing assets'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This output isn't very descriptive of the task being completed. Maybe log "Creating asset directories"?
@@ -0,0 +1,89 @@ | |||
import {promises as fs} from 'fs'; | |||
|
|||
export default class cliManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes should always be capitalized
if (currentCommandPath['_default']){ | ||
if (currentCommandPath['_default'].args.length == args.length){ | ||
break; | ||
} else { | ||
console.log(`The ${args[0]} command was expecting ${currentCommandPath['_default'].args.length - 1} arguments like so: oblecto ${currentCommandPath['_default'].args.join(" ")}`); | ||
return; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seams like it could be simplified to not have so many nested blocks
Very nice additions! |
Refactors the CLI to make adding commands much easier