Permalink
Browse files

Add Makefile

- remove direct coffee-script dependency
- remove old prepublish script
  • Loading branch information...
1 parent 4ca3469 commit 833e24f3683b26f3c6c95056f566a0fbe73049eb @grncdr grncdr committed Apr 8, 2012
View
@@ -1,3 +1,5 @@
node_modules
.DS_Store
.build
+lazorse.js
+lib
View
@@ -0,0 +1,30 @@
+.PHONY : test
+
+PATH := ./node_modules/.bin/:$(PATH)
+LIBS = $(subst src,lib,$(subst coffee,js,$(wildcard ./src/*.coffee)))
+HEAD = $(shell git describe --contains --all HEAD)
+REPORTER ?= dot
+
+all : lazorse.js $(LIBS)
+
+lib/%.js : src/%.coffee
+ @mkdir -p lib
+ @coffee -pbc $< > $@
+
+test : all
+ @mocha --compilers coffee:coffee-script --reporter $(REPORTER)
+
+%.js : %.coffee
+ @coffee -pbc $< > $@
+
+clean :
+ @rm *.js lib/*.js || true
+
+pages :
+ $(MAKE) -C doc html
+
+release : test pages
+ git checkout gh-pages
+ cp -R doc/.build/html/ .
+ git commit -a -m v$(npm_package_version)
+ git checkout $(HEAD)
View
@@ -20,17 +20,17 @@
"node": ">=0.4.0"
},
"dependencies": {
- "coffee-script": "~1.2.0",
"connect": "~2.0.0",
"uri-template": "~0.3.0"
},
"devDependencies": {
"mocha": "~1.0.0",
+ "coffee-script": "~1.2.0",
"consolidate": "0.1.0"
},
"scripts": {
- "test": "mocha",
- "prepublish": "coffee prepublish.coffee"
+ "test": "make test",
+ "prepublish": "make release"
},
"optionalDependencies": {}
}
View
@@ -1,24 +0,0 @@
-{spawn} = require 'child_process'
-
-chain = (cmds) ->
- next = ->
- return unless cmds?.length
- args = cmds.shift().split(' ')
- cmd = args.shift()
- console.log {cmd, args}
- spawn(cmd, args).on 'exit', (code, signal) ->
- if code
- console.error "FAILED: #{cmd} #{args.join ' '}"
- return process.exit code
- next()
- console.log cmds
- next()
-
-chain [
- 'npm test'
- 'make -C doc html'
- 'git checkout gh-pages'
- 'cp -R doc/.build/html/ .'
- "git commit -a -m v#{process.env.npm_package_version}"
- "git checkout master"
-]
File renamed without changes.
File renamed without changes.

0 comments on commit 833e24f

Please sign in to comment.