Add support for Cygwin-style absolute paths on Windows Systems #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses Issue #37
Obviously it is customary to run CoffeeScript under Node.js. For Windows users, it is common to compile Node.js with Cygwin in order to use CoffeeScript. However, Cygwin expects it's own style of absolute paths (prefixed with
/cygdrive/C
), which of courseexpand-file-name
does not expand to. Given these restrictions, at the present time coffee-mode's file compilation functionality does not work on Windows.I've implemented three things:
coffee-cygwin-mode
customizable var, for enabling/disabling support for Cygwin-style paths on Windows for CoffeeScript commandscoffee-cygwin-prefix
customizable var, to allow people to set/cygdrive/C
to whatever their Cygwin expects to see (dependent on installation)coffee-cygwin-path
function, which given an expanded file name will return a Cygwin-style absolute path + file nameFinally, I tweaked
coffee-command-compile
to leverage these settings when thesystem-type
iswindows-nt
.Without these changes, this mode's file compilation functionality does not work on Windows for the "canonical" setup of CoffeeScript on Node.js.