Permalink
Browse files

add cake task for building examples

  • Loading branch information...
1 parent 957ca18 commit 1b5d9f2f9c658c98cbd32db16e5bc481e5922501 @ddollar committed Apr 30, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 Cakefile
View
@@ -144,3 +144,15 @@ task 'watch', 'compile and watch', -> build true, -> log ":-)", green
# cake test
# ```
task 'test', 'run tests', -> build -> mocha -> log ":)", green
+
+## custom tasks
+
+build_examples = ->
+ fs.readdir __dirname + "/example/", (err, list) ->
+ for item in list.filter ((item) -> !item.match(/\.tgz$/))
+ console.log "building example: #{item}"
+ builder = spawn "tar", ["czf", "../#{item}.tgz", "."], cwd:"#{__dirname}/example/#{item}"
+ builder.stdout.pipe(process.stdout)
+ builder.stderr.pipe(process.stderr)
+
+task 'examples', 'build examples', -> build_examples -> log ":)", green

0 comments on commit 1b5d9f2

Please sign in to comment.