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

49 init config #57

Merged
merged 10 commits into from
Oct 9, 2018
Merged

49 init config #57

merged 10 commits into from
Oct 9, 2018

Conversation

rpigu-i
Copy link
Collaborator

@rpigu-i rpigu-i commented Oct 8, 2018

Created two new commands:

  1. init - creates a capsule.json file with the project parameters

  2. deploy - deploys the capsule.json file

theneverstill
theneverstill previously approved these changes Oct 8, 2018
Copy link
Contributor

@theneverstill theneverstill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using const instead of let when variables don't change.

bin/capsule.js Outdated Show resolved Hide resolved
bin/capsule.js Outdated Show resolved Hide resolved
bin/capsule.js Outdated
.description('Define the project parameters')
.action(async function (options) {
commander.type = 'init'
let generic_questions = await parseJsonConfig(`${paths.base}/${paths.base_config}`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably safer to use path.resolve for these paths

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per your previous comment, I've updated const paths to use:

base: path.resolve(__dirname, '../'),

So any reference to path.base now uses the path.resolve method. Is this what you had in mind?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constructing paths with path.resolve is a bit safer than joining with /, especially for cross-platform support

I would play it safe on this line and the following like this:

const generic_questions = await parseJsonConfig(path.resolve(paths.base, paths.base_config))
const ci_questions = await parseJsonConfig(path.resolve(paths.base, paths.ci_config))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh OK gotcha, sorry misread the initial comment!

@rpigu-i
Copy link
Collaborator Author

rpigu-i commented Oct 9, 2018

@theneverstill I've updated some of the variables to be const rather than let as per your comment.

grgur
grgur previously approved these changes Oct 9, 2018
@rpigu-i
Copy link
Collaborator Author

rpigu-i commented Oct 9, 2018

@theneverstill and @grgur Have addressed the comments from above.

Please review again. Thanks!

@grgur
Copy link
Member

grgur commented Oct 9, 2018

i was faster

@rpigu-i
Copy link
Collaborator Author

rpigu-i commented Oct 9, 2018

@grgur haha OK, I had to push a second commit up - can you confirm again?

@grgur grgur merged commit 4990a51 into master Oct 9, 2018
@grgur grgur deleted the 49_init_config branch October 9, 2018 15:13
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.

None yet

3 participants