CoffeScript (1.1.1) on Windows: simple method !

June 10, 2011

CoffeScript (1.1.1) on Windows: simple method !

Inspiration: http://blog.mnasyrov.com/post/2872046541/coffeescript-on-windows-how-to-roast-coffee

To use CoffeScript you need:

  1. Node.js
  2. CoffeeScript
  3. Batch file to run CoffeeScript

 

STEP 1: Node.js

  I’m very very lazy dev… :D And i don’t recompile NodeJs into Windows….. but I’m using v0.4.7 from http://node-js.prcn.co.cc/ [many thx] and install into:

D:>cd ToolsNodeJsbin

D:ToolsNodeJsbin>node –version v0.4.7

 

STEP 2: CoffeeScript

  Use the last version , grab it from https://github.com/jashkenas/coffee-script and install into:

D:ToolsCoffeeScript

Check version

D:ToolsNodeJsbinnode /cygdrive/D/Tools/CoffeeScript/bin/coffee –version CoffeeScript version 1.1.1

Node.js need unix-path

Step 3: Batch file

  I don’t know well bat syntax, and my code is VERY VERY ugly.. but it works :P  

@echo off
SET nodeDir=D:ToolsNodeJsbin
SET nodeDir=D:ToolsNodeJsbin
SET nodeDir=D:ToolsNodeJsbin
bin
SET i=%9
:: Check input value if exist and if it’s option or file
SET i=%9
:: Check input value if exist and if it’s option or file
n or file
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %9’) DO SET i=%%o
u %9’) DO SET i=%%o

:COMMAND FOR /f %%o IN (‘%nodeDir%/cygpath.exe -a -u %coffeeDir%’) DO SET p=%%o %nodeDir%node %p%/coffee %a% %b% %c% %d% %e% %f% %g% %h% %i%

  set the PATH environment variable contains a path to coffee.bat the name of the file is very important,  in my case it works well with coffee-rack Enjoy Many thanks to: Mikhail Nasyrov => http://blog.mnasyrov.com/post/2872046541/coffeescript-on-windows-how-to-roast-coffee Node.js self-contained Windows binaries => http://node-js.prcn.co.cc/index.html Jeremy Ashkenas => http://jashkenas.github.com/coffee-script/


comments powered by Disqus