Permalink
Browse files

install travis CI

  • Loading branch information...
hickford committed Apr 2, 2013
1 parent 9e2bd2e commit c85df32565d5c6a3b6a08e00a4d6992f6e61daee
Showing with 21 additions and 13 deletions.
  1. +8 −0 .travis.yml
  2. +12 −12 Cakefile
  3. +1 −1 package.json
View
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+ - "0.10"
+ - "0.8"
+ - "0.6"
+
+before_script:
+ icake build
View
@@ -1,26 +1,26 @@
path = require 'path'
fs = require 'fs'
+spawn = (require 'child_process').spawn
wrench = require 'wrench'
+# Run a CoffeeScript through our node/coffee interpreter.
+run = (args, cb) ->
+ proc = spawn 'node', ['./node_modules/iced-coffee-script/bin/coffee'].concat(args)
+ proc.stderr.on 'data', (buffer) -> console.log buffer.toString()
+ proc.on 'exit', (status) ->
+ process.exit(1) if status != 0
+ cb() if typeof cb is 'function'
+
task 'build', 'Compile IcedCoffeeScript source to Javascript', ->
invoke 'clean'
- command = require 'iced-coffee-script/lib/coffee-script/command'
- process.argv[2..]=['-o','lib','-c','src']
- command.run() # alas, this returns early and doesn't indicate error
-
- # prepend shebang until issue fixed
- # https://github.com/jashkenas/coffee-script/issues/2215
+ await run ['-o','lib','-c','src'], defer()
+ # prepend shebang manually until issue fixed
+ # https://github.com/jashkenas/coffee-script/issues/2215
script_path = path.join('lib','imgurgitate.js')
shebang = "#!/usr/bin/env node"
-
- # wait until script built
- while ! fs.existsSync(script_path)
- await setTimeout(defer(),1000)
-
fs.writeFileSync(script_path,[shebang,fs.readFileSync(script_path)].join("\n"))
-
task 'clean', 'Clean build matter', ->
wrench.rmdirSyncRecursive('lib',true)
wrench.rmdirSyncRecursive('-p',true)
View
@@ -30,7 +30,7 @@
"url": "https://matt-hickford@github.com/matt-hickford/imgurgitate.git"
},
"engines": {
- "node": "~0.8.0"
+ "node": "0.8.x"
},
"dependencies": {
"http-get": ">=0.5.7",

0 comments on commit c85df32

Please sign in to comment.