node.js - Using nant to compile LESS via exec -
node.js - Using nant to compile LESS via exec -
i have continuous integration server running cruisecontrol.net on windows server 2012. service runs user ccnet. have logged on server via rdp, opened command window, , verified path contains c:\tools\nodejs.
i installed less globally, since have bunch of projects i'm starting utilize less in, , ci server, makes sense have single instance of it, rather have install every single project (the projects don't need run locally; utilize lessjs in development flags remove when not running in debug mode).
c:\tools\nodejs>npm install less -g c:\users\ccnet\appdata\roaming\npm\lessc -> c:\users\ccnet\appdata\roaming\npm\node_modules\less\bin\lessc less@1.7.3 c:\users\ccnet\appdata\roaming\npm\node_modules\less ├── graceful-fs@2.0.3 ... etc... i can invoke lessc manually:
c:\cruisecontrol\myproject\private\working>lessc.cmd website\content\myproject.less myproject.css c:\cruisecontrol\myproject\private\working>dir myproject.css ... 06/24/2014 11:52 159,145 myproject.css but when seek run via exec in nant, infamous "module not found":
module.js:340 throw err; ^ error: cannot find module 'c:\cruisecontrol\myproject\private\working\node_modules\less\bin\lessc' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.runmain (module.js:492:10) @ process.startup.processnexttick.process._tickcallback (node.js:244:9) clearly it's looking in wrong place less. why? path right noted. works command line. workingdir attribute set same folder in command-line example.
is there improve way set ci scenario?
i able prepare problem tricking nant.
realizing ran fine command prompt, told nant invoke command prompt, /c parameter, followed lessc , parameters wanted pass it:
<exec program="cmd.exe" workingdir="${buildfolder}" failonerror="true"> <arg line="/c lessc.cmd --clean-css website\content\site.less website\content\site.min.css" /> </exec> node.js less npm cruisecontrol.net nant
Comments
Post a Comment