Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add json-file option to choose a file to be merged with package.json #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

desjoerd
Copy link

I needed the option to choose a file instead of using "cat" to include the package.json to be merged. This is because I need to use CMD or Powershell which doesn't have "cat" with the same escaping as bash.

I hope that this change will be merged.

.parse(process.argv);

console.log('Demeteorizing application...');

Program.output = Program.output || Path.join(process.cwd(), '.demeteorized');

if(Program.jsonFile) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: can you amend to add a space after the if to match style :)

@jackboberg
Copy link
Contributor

This seems sensible, I'll test locally...

@theworkflow
Copy link
Contributor

@desjoerd thanks for the PR! Can you add some tests?

@jackboberg
Copy link
Contributor

@HarlanJ there is currently no test coverage for bin/demeteorizer. Seems like a big request create for a small addition...

That said, if you want to do the legwork 💯

@@ -22,11 +23,19 @@ Program
.option(
'-j, --json <json>',
'JSON data to be merged into the generated package.json')
.option(
'-J, --json-file <jsonFile>'
Copy link
Contributor

Choose a reason for hiding this comment

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

missing trailing ,

@desjoerd
Copy link
Author

Sorry about the late comment! I will take a look how I can add some tests. I see two options:

  1. add a unit test file for bin/demeteorizer
  2. move the json parsing to lib/update-package, but then it won't warn as fast about a faulty json.

I think option 1 is the best option. What do you guys think?

@theworkflow
Copy link
Contributor

@desjoerd sorry for being so late on this. Can you fix the merge conflict so we can look this over again?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants