Skip to content

coffee DIR executes DIR/index.coffee #3292

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

Merged
merged 1 commit into from
Dec 29, 2013

Conversation

marchaefner
Copy link
Collaborator

Resolves #2496 and brings the CLI behavior for directories in line with redux, node and coco/LS. Runs either index.coffee, index.litcoffee or index.coffee.md (just like require DIR does already).

coffee --watch DIR watches and (re-)runs only the index file (and no longer all contained coffee files and subdirectories). This behavior is copied from coco/LS and provides a nice symmetry between invocations with and without --watch, but I'm not entirely sure about potential use cases...

@vendethiel
Copy link
Collaborator

Thanks ! But isn't the error message inaccurate ?

@marchaefner
Copy link
Collaborator Author

Yeah, it's far from perfect. It's meant as a compromise between accuracy and readability comprehensibility. Suggestions for a better message are very welcome.

@michaelficarra
Copy link
Collaborator

LGTM. Merging. @jashkenas: This is a breaking change we'll need to note in the changelog for the next release.

michaelficarra added a commit that referenced this pull request Dec 29, 2013
`coffee DIR` executes `DIR/index.coffee`
@michaelficarra michaelficarra merged commit 1f301d8 into jashkenas:master Dec 29, 2013
@aseemk
Copy link
Contributor

aseemk commented Dec 31, 2013

This is an awesome improvement — thanks! Just wanted to note though that full Node parity means also respecting the directory's package.json main field, if there is one. My understanding is that you can access this entire algorithm via require('module')._resolveFilename(path), but that may be outdated.

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.

coffee dir executes every coffee file, vs node dir which executes index.js only.
4 participants