Created
August 4, 2012 09:14
-
-
Save jiewmeng/3256237 to your computer and use it in GitHub Desktop.
Cakefile to start Express app, watch & compile CoffeeScript & Stylus files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{spawn, exec} = require "child_process" | |
# process the output of a spawned process | |
# see **[link](http://stackoverflow.com/a/7376108/292291)** | |
processOutput = (proc) -> | |
proc.stdout.on "data", (data) -> | |
console.log data.toString().trim() | |
task "startdev", "Starts server with nodemon and watch files for changes", -> | |
# start nodemon server | |
nodemon = spawn "nodemon", ["server.coffee"] | |
processOutput nodemon | |
# watch and compile CoffeeScript | |
coffee = spawn "coffee", ["-o", "public/js/app", "-cw", "clientAssets/coffee"] | |
processOutput coffee | |
# watch and compile Stylus | |
stylus = spawn "stylus", ["clientAssets/stylus", "-l", "-w", "-o", "public/css/app"] | |
processOutput stylus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment