Skip to content

Commit

Permalink
Shortcuts for buildin techs
Browse files Browse the repository at this point in the history
  • Loading branch information
veged committed Sep 5, 2011
1 parent 4c05da4 commit 1fcc401
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Expand Up @@ -5,6 +5,6 @@ all: $(patsubst %.ometajs,%.ometajs.js,$(shell find lib -name '*.ometajs'))
ometajs2js -i $< -o $@

tests:
./bin/borschik -t ./lib/techs/css.js -i tests/a.css -o tests/_a.css
./bin/borschik -t css -i tests/a.css -o tests/_a.css

.PHONY: all tests
5 changes: 4 additions & 1 deletion lib/borschik.js
Expand Up @@ -16,7 +16,10 @@ exports.COA = require('coa').Cmd()
.short('t').long('tech')
.def(__dirname + '/tech.js')
.val(function(t) {
return new (require(PATH.resolve(t)).Tech)() })
t = /^[^.][^\/]*$/g.test(t) ?
__dirname + '/techs/' + t + '.js' :
PATH.resolve(t);
return new (require(t).Tech)() })
.end()
.opt()
.name('input').title('Input path, required')
Expand Down

0 comments on commit 1fcc401

Please sign in to comment.