Created
April 14, 2011 22:18
-
-
Save topfunky/920698 to your computer and use it in GitHub Desktop.
Watch both Sass and Coffee files and compile on change (for Node.js)
This file contains 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
### | |
Modified from https://github.com/jashkenas/coffee-script/blob/master/Cakefile | |
Part of an upcoming PeepCode screencast. This snippet is MIT Licensed. | |
### | |
{spawn, exec} = require 'child_process' | |
task 'assets:watch', 'Watch source files and build JS & CSS', (options) -> | |
runCommand = (name, args) -> | |
proc = spawn name, args | |
proc.stderr.on 'data', (buffer) -> console.log buffer.toString() | |
proc.stdout.on 'data', (buffer) -> console.log buffer.toString() | |
proc.on 'exit', (status) -> process.exit(1) if status != 0 | |
runCommand 'sass', ['--watch', 'public/css/sass:public/css'] | |
runCommand 'coffee', ['-wc', 'public/js', 'test-js'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment