mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
ensuring that we don't write --eval scriptlets out to disk -- they should print, if nothing else
This commit is contained in:
@@ -78,10 +78,10 @@
|
|||||||
js = coffee.compile(code, o);
|
js = coffee.compile(code, o);
|
||||||
if (opts.run) {
|
if (opts.run) {
|
||||||
return eval(js);
|
return eval(js);
|
||||||
} else if (opts.print) {
|
|
||||||
return puts(js);
|
|
||||||
} else if (opts.lint) {
|
} else if (opts.lint) {
|
||||||
return lint(js);
|
return lint(js);
|
||||||
|
} else if (opts.print || opts.eval) {
|
||||||
|
return puts(js);
|
||||||
} else {
|
} else {
|
||||||
return write_js(source, js);
|
return write_js(source, js);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ compile_script: (source, code) ->
|
|||||||
else if opts.tree then puts coffee.tree(code).toString()
|
else if opts.tree then puts coffee.tree(code).toString()
|
||||||
else
|
else
|
||||||
js: coffee.compile code, o
|
js: coffee.compile code, o
|
||||||
if opts.run then eval js
|
if opts.run then eval js
|
||||||
else if opts.print then puts js
|
else if opts.lint then lint js
|
||||||
else if opts.lint then lint js
|
else if opts.print or opts.eval then puts js
|
||||||
else write_js source, js
|
else write_js source, js
|
||||||
catch err
|
catch err
|
||||||
if opts.watch then puts err.message else throw err
|
if opts.watch then puts err.message else throw err
|
||||||
|
|||||||
Reference in New Issue
Block a user