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

Support passing in dependencies directly via -f json -d file.json #21

Merged
merged 2 commits into from
Apr 18, 2015

Conversation

deanrad
Copy link
Contributor

@deanrad deanrad commented Apr 15, 2015

With example.json containing:
{"a":["sub/b"],"d":[],"fancy-main/not-index":[],"sub/b":["sub/c"],"sub/c":["d"]}

New feature:
./bin/dependo -f json -d example.json > example/index.html ; open example/index.html
Regression tested with:
./bin/dependo -f cjs lib/ > example/index.html ; open example/index.html

console.log(Commander.helpInformation());
process.exit(1);

if (Commander.format !== "json" && !Commander.args.length) {
Copy link
Owner

Choose a reason for hiding this comment

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

Why is there this special check for Commander.format !== "json"?

@auchenberg
Copy link
Owner

Looks good. I'm a but unsure about the above if-condition, once resolved. I'll merge, and make a new release.

@deanrad
Copy link
Contributor Author

deanrad commented Apr 17, 2015

Because in json format you pass the file containing the deps data, you don't need spider files, making the CLI arg required only for the previous use cases.

@auchenberg
Copy link
Owner

We agree that to pass the file you need to pass the file via --deps as dependo -f json --deeps <file>, right?

The above condition is to display a nice help message if no arguments are passed like dependo. What case does the current condition cover? If I pass -f json, Commander.args anyway has a length?

@deanrad
Copy link
Contributor Author

deanrad commented Apr 18, 2015

If I pass -f json, Commander.args anyway has a length?

Not correct. Commander.args doesn't include switches/options/whatever they're called :)

But see the latest diff - I think it will satisfy us both, and be simpler.

> dependo              # prints help
> dependo -f cjs       # prints help
> dependo -f json      # prints help
> dependo -f json  file.json   # does good
> dependo -f cjs  dir/         # does good

@auchenberg
Copy link
Owner

Totally makes sense to use pass the file as the "input" in first argument. 👍

auchenberg added a commit that referenced this pull request Apr 18, 2015
Support passing in dependencies directly via -f json file.json
@auchenberg auchenberg merged commit 40f8f4f into auchenberg:master Apr 18, 2015
@deanrad
Copy link
Contributor Author

deanrad commented Apr 18, 2015

Cool- were on a roll !

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