Merge pull request #42 from aeosynth/mayhem
Cakefile and console tweaks
This commit is contained in:
commit
8d7b824362
@ -171,11 +171,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof console !== "undefined" && console !== null) {
|
log = console.log.bind(console);
|
||||||
log = function(arg) {
|
|
||||||
return console.log(arg);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Object.keys) {
|
if (!Object.keys) {
|
||||||
Object.keys = function(o) {
|
Object.keys = function(o) {
|
||||||
|
|||||||
9
Cakefile
9
Cakefile
@ -76,17 +76,14 @@ HEADER = """
|
|||||||
INFILE = 'script.coffee'
|
INFILE = 'script.coffee'
|
||||||
OUTFILE = '4chan_x.user.js'
|
OUTFILE = '4chan_x.user.js'
|
||||||
|
|
||||||
build = ->
|
task 'build', ->
|
||||||
exec 'coffee --print script.coffee', (err, stdout, stderr) ->
|
exec 'coffee --print script.coffee', (err, stdout, stderr) ->
|
||||||
throw err if err
|
throw err if err
|
||||||
fs.writeFile OUTFILE, HEADER + stdout, (err) ->
|
fs.writeFile OUTFILE, HEADER + stdout, (err) ->
|
||||||
throw err if err
|
throw err if err
|
||||||
|
|
||||||
task 'build', ->
|
|
||||||
build()
|
|
||||||
|
|
||||||
task 'dev', ->
|
task 'dev', ->
|
||||||
build()
|
invoke 'build'
|
||||||
fs.watchFile INFILE, interval: 250, (curr, prev) ->
|
fs.watchFile INFILE, interval: 250, (curr, prev) ->
|
||||||
if curr.mtime > prev.mtime
|
if curr.mtime > prev.mtime
|
||||||
build()
|
invoke 'build'
|
||||||
|
|||||||
@ -99,10 +99,7 @@ config =
|
|||||||
'Interval': 30
|
'Interval': 30
|
||||||
|
|
||||||
# XXX chrome can't into `{log} = console`
|
# XXX chrome can't into `{log} = console`
|
||||||
if console?
|
log = console.log.bind console
|
||||||
# XXX scriptish - console.log.apply is not a function
|
|
||||||
log = (arg) ->
|
|
||||||
console.log arg
|
|
||||||
|
|
||||||
# XXX opera cannot into Object.keys
|
# XXX opera cannot into Object.keys
|
||||||
if not Object.keys
|
if not Object.keys
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user