-
Notifications
You must be signed in to change notification settings - Fork 2k
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
CLI: Allow user to set output filename #2870
Comments
Completely agreed. This is all fixed in redux. |
Any idea when it's going to make its way into the shipping version? |
You can always use the coffee -cs <src/bla.coffee >lib/master.js |
+1 |
1 similar comment
+1 |
Do we
|
I'd vote for the second one. |
I'd go with 0. do nothing; recommend use of |
|
warn when passing multiple file names OR join by default |
@michaelficarra, well, yeah, i'd rather go with the same option of using stdin/stdout. I very much dislike all the bloat of having redundant options on UNIX-like commands. But given that the Coffee compiler already takes its input and output as file name arguments, i think that the second option mentioned by @Nami-Doc would be the best compromise. |
Hey all, Suggestion: just take a look at how Uglify.js 2.0 handles this and copy them. Uglify gives me all sorts of control over the output path, filename and even the path parameters in the sourcemap --- which is exactly what I need to build support for CS Sourcemaps into CodeKit. I gather that most of you are command line junkies and I sense a bit of disdain for folks that aren't. But there's a lot of people out there who want to use CS through a graphical app like mine and to give them all the features CS has to offer, I need a bit of help on your end. What is the downside of adding flexibility to the API if it helps expand the reach of CS and does not negatively affect any existing CLI users? On Apr 25, 2013, at 11:18, Demian Ferreiro notifications@github.com wrote:
|
…s a file and not a path, save as the desired filename
* Fix #2870: If --output ends with a filename, and the input is a file and not a path, save as the desired filename * If an output path ends in a slash, force saving into an output folder even if that folder name would contain a period (e.g. /scripts.js/); if output filename is only periods, treat it as a path * Restrict exceptions
Fixed by #4661. |
Suppose we have a file named "master.coffee".
Right now, the CLI for CoffeeScript allows us to specify a specific folder where we want the compiled Javascript file created:
This will generate the following file:
But in many cases, we might want the name of the output file to be different than the name of the source file. I would like the --output flag to support this possibility. If the supplied path ends with a file rather than a folder, the Coffee compiler should use that name for the output file. Example:
CoffeeScript is the only "cutting edge" tool on the market that doesn't have the capability to specify complete output file paths. I know it may seem like a small thing, but when building CoffeeScript into other apps or tools, it really is a frustrating limitation. It's even more of an issue now that CS supports source maps, so we can't just change the file names on the fly; they're hard-coded into the maps.
The text was updated successfully, but these errors were encountered: