Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

haylinmoore
Copy link
Contributor

Refactors the CLI to make adding commands much easier

@@ -2,6 +2,7 @@ import {promises as fs} from 'fs';
import generateAssetDirectories from '../helpers/generateAssetDirectories';

export default async (args) => {
console.log('Initing assets');
Copy link
Owner

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 {
Copy link
Owner

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

Comment on lines +41 to +48
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;
}
}
Copy link
Owner

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

@robinp7720
Copy link
Owner

robinp7720 commented Oct 17, 2020

Very nice additions!

@haylinmoore haylinmoore marked this pull request as draft October 17, 2020 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants