Permalink
Browse files

Added flour to Cakefile.

Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
  • Loading branch information...
1 parent 2cccaaf commit 8fdfc274280da4e41a4b17dde2b4f62f0d6de3b9 @creatorrr committed Apr 1, 2013
Showing with 15 additions and 15 deletions.
  1. +11 −15 Cakefile
  2. +4 −0 package.json
View
@@ -1,18 +1,14 @@
-fs = require 'fs'
+require 'flour'
-{print} = require 'sys'
-{spawn} = require 'child_process'
+{readdirSync} = require 'fs'
-build = (callback, opts...) ->
- options = ['-c', '-o', 'lib', 'src']
- options.unshift opts... if opts
- coffee = spawn 'coffee', options
- coffee.stderr.on 'data', (data) ->
- process.stderr.write data.toString()
- coffee.stdout.on 'data', (data) ->
- print data.toString()
- coffee.on 'exit', (code) ->
- callback?() if code is 0
+task 'build', 'Compile .coffee files in src/ to lib/', ->
+ isCoffee = (file) -> /\.(coffee|litcoffee|coffee\.md)$/.test file
-task 'build', 'Build .coffee files.', build
-task 'watch', 'Watch and build .coffee files.', -> build null, '-w'
+ for file in files = readdirSync 'src' when isCoffee file
+ compile "src/#{ file }", "lib/#{ compiled = file.replace /(coffee)$/, 'js' }"
+
+task 'compile', 'Alias: build', -> invoke 'build'
+
+task 'watch', 'Watch and compile .coffee files.', ->
+ watch 'src/*.*', -> invoke 'build'
View
@@ -16,6 +16,10 @@
"node-rdio": ">= 0.1.1",
"hubot.io": ">= 0.1.3"
},
+ "devDependencies": {
+ "flour": "0.5.x",
+ "coffee-script": ">= 1.6.2"
+ },
"keywords": [
"hubot",
"rdio",

0 comments on commit 8fdfc27

Please sign in to comment.