-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhs.js
24 lines (21 loc) · 774 Bytes
/
hs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var item = require('hotshell').item
var exec = require('hotshell').exec
var _ = require('underscore')
item({desc: 'hotshell-util'}, function () {
item({key: 'e', desc: 'examples'}, function () {
_(exec('ls examples/**/*.js').split('\n')).each(function (el, ix) {
var name = basename(el)
var dir = dirname(el)
item({key: ix, desc: dir, cmd: 'cd ' + dir + '; hs -f ' + name})
})
})
item({key: 't', desc: 'run tests', cmd: 'npm test'})
item({key: 'i', desc: 'install dependencies', cmd: 'npm install'})
item({key: 'r', desc: 'release new version', cmd: './release.sh'})
})
function basename(path) {
return path.replace(dirname(path), "")
}
function dirname(path) {
return path.match(".*/")[0]
}