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

merged 2 commits into from Aug 16, 2011


None yet

2 participants

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.

semperos added some commits Aug 5, 2011
@semperos semperos Add support for Cygwin-style absolute paths, which makes using the fi…
…le compilation feature of CoffeeScript mode possible on Windows systems where Node.js is compiled with Cygwin
@semperos semperos Create function to encapsulate logic of supporting Cygwin-based Windo…
…ws paths, use in coffee-command-compile
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 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