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

'coffee' silently fails with no output when the --join option is specified and the source files specified include directories #1388

Merged
merged 1 commit into from
May 25, 2011

Conversation

johnyanarella
Copy link
Contributor

The command-line compiler fails silently with no output when the --join option is specified and the source files specified include directories.

The current --join handling logic in compile() assumes that the source being compiled is among the explicit list of source files specified for compilation. When one of those source files is a directory, compile() is called recursively with files that were not among the original explicitly specified list of source files, invalidating that assumption.

This patch tweaks the compileScript logic to ensure that the recursively read directory content is aggregated and joined, while still preserving the content order of the original source files specified at the command line.

For instance:

coffee --join output.js --compile src/Main.coffee src/model/ src/service/

would join Main.coffee + all .coffee files (recursively) in src/model + all .coffee files (recursively) in src/service/

@michaelficarra
Copy link
Collaborator

Since this approach changes the ::compile API, it's going to have to wait until at least the next major release before being merged.

@johnyanarella
Copy link
Contributor Author

To clarify - this just alters the named closure within command module's private compileScript method, which has no relation to the public compile method exported by the coffee-script module.

@johnyanarella
Copy link
Contributor Author

Sorry - I can see how the original description would be misleading. :)

@michaelficarra
Copy link
Collaborator

Oh, you're right. My mistake. Looks good to me.

michaelficarra added a commit that referenced this pull request May 25, 2011
'coffee' silently fails with no output when the --join option is specified and the source files specified include directories
@michaelficarra michaelficarra merged commit bbf37e5 into jashkenas:master May 25, 2011
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