@@ -4,10 +4,14 @@ util = require 'util'
4
4
{inspect } = util
5
5
fs = require ' fs'
6
6
path = require ' path'
7
- extrafs = require ' ./node_modules/fs-extra'
7
+ # extrafs = require './node_modules/fs-extra'
8
8
coffee = require ' ./node_modules/coffee-script'
9
9
_ = require ' ./node_modules/underscore'
10
10
11
+ exec = (cmd , options , callback = null )->
12
+ log " Executing `#{ cmd} `"
13
+ require (' child_process' ).exec cmd, options, callback
14
+
11
15
# ## compileCoffeescripts(directory, option={})
12
16
#
13
17
# Compile all the coffeescripts into javascript files from a directory
@@ -43,10 +47,6 @@ compileCoffeescripts = (directory, options={})->
43
47
# Generate doc with [docco-husky](https://github.com/mbrevoort/docco-husky)
44
48
# and push it to the `gh-pages` branch.
45
49
generateDoccoHusky = (directories )->
46
- exec = (cmd , options , callback = null )->
47
- log " Executing `#{ cmd} `"
48
- require (' child_process' ).exec cmd, options, callback
49
-
50
50
directories = (_ .flatten ([directories])).join ' '
51
51
directory = path .resolve ' ./'
52
52
@@ -60,8 +60,7 @@ generateDoccoHusky = (directories)->
60
60
error err if err?
61
61
log stdout
62
62
63
- # Change branch to gh-pages
64
-
63
+ # Change branch to gh-pages
65
64
exec " git checkout gh-pages" , {cwd : tmp}, (err , stdout , stderr )->
66
65
log ' testststst #{err}'
67
66
error err if err?
@@ -88,7 +87,7 @@ generateDoccoHusky = (directories)->
88
87
log stdout
89
88
90
89
# Remove the docs directory
91
- extrafs . remove ' docs' , ->
90
+ exec " rm docs"
92
91
93
92
94
93
task ' doc' , ' Regenerate doc' , (options )->
@@ -99,6 +98,8 @@ task 'build', 'build scripts to be compatible with js', ->
99
98
compileCoffeescripts ' lib'
100
99
101
100
task ' clean' , ' Remove all js files' , ->
102
- extrafs .remove ' bin/ready.js' , ->
103
- exec ' rm lib/*.js'
101
+ exec ' rm bin/ready.js' , (err , stdout , stderr )->
102
+ log stderr
103
+ exec ' rm lib/*.js' , (err , stdout , stderr )->
104
+ log stdout
104
105
0 commit comments