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

Add support for Cygwin-style absolute paths on Windows Systems #42

Merged
merged 2 commits into from
Aug 16, 2011
Merged

Add support for Cygwin-style absolute paths on Windows Systems #42

merged 2 commits into from
Aug 16, 2011

Conversation

semperos
Copy link
Contributor

@semperos semperos commented Aug 5, 2011

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 course expand-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:

  • A coffee-cygwin-mode customizable var, for enabling/disabling support for Cygwin-style paths on Windows for CoffeeScript commands
  • A coffee-cygwin-prefix customizable var, to allow people to set /cygdrive/C to whatever their Cygwin expects to see (dependent on installation)
  • A coffee-cygwin-path function, which given an expanded file name will return a Cygwin-style absolute path + file name

Finally, I tweaked coffee-command-compile to leverage these settings when the system-type is windows-nt.

Without these changes, this mode's file compilation functionality does not work on Windows for the "canonical" setup of CoffeeScript on Node.js.

…le compilation feature of CoffeeScript mode possible on Windows systems where Node.js is compiled with Cygwin
@semperos
Copy link
Contributor Author

semperos commented Aug 5, 2011

Second commit encapsulates the system check and Cygwin path support in a single function, coffee-universal-path. Returns the regular expanded file name for all other systems, like this mode already does.

defunkt added a commit that referenced this pull request Aug 16, 2011
Add support for Cygwin-style absolute paths on Windows Systems
@defunkt defunkt merged commit 58c1401 into defunkt:master Aug 16, 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