Report errors when writing files in `coffee`.
This commit is contained in:
parent
87560d943c
commit
e5dfa19ec9
|
@ -166,7 +166,7 @@
|
|||
js = ' ';
|
||||
}
|
||||
return fs.writeFile(jsPath, js, function(err) {
|
||||
return opts.compile && opts.watch ? puts("Compiled " + source) : undefined;
|
||||
return err ? puts(err.message) : (opts.compile && opts.watch ? puts("Compiled " + source) : undefined);
|
||||
});
|
||||
};
|
||||
return path.exists(dir, function(exists) {
|
||||
|
|
|
@ -149,7 +149,8 @@ writeJs = (source, js, base) ->
|
|||
compile = ->
|
||||
js = ' ' if js.length <= 0
|
||||
fs.writeFile jsPath, js, (err) ->
|
||||
puts "Compiled #{source}" if opts.compile and opts.watch
|
||||
if err then puts err.message
|
||||
else if opts.compile and opts.watch then puts "Compiled #{source}"
|
||||
path.exists dir, (exists) ->
|
||||
if exists then compile() else exec "mkdir -p #{dir}", compile
|
||||
|
||||
|
|
Loading…
Reference in New Issue