gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.32k stars 155 forks source link

Better shebang support needed #1030

Closed nazar-pc closed 6 years ago

nazar-pc commented 6 years ago

Currently

``#!/usr/bin/env node``

compiles to

// Generated by LiveScript 1.5.0
#!/usr/bin/env node
(function(){

}).call(this);

I know there are options that allow to remove Generated by line as well as function wrapper, but I believe this should work properly even if those are not used.

Ideally, LiveScript should blindly preserve anything that is on the first line and starts with #!, without any need for backticks or additional CLI options.

TL;DR:

#!/usr/bin/env node
console.log 'Hello'

should compile to

#!/usr/bin/env node
// Generated by LiveScript 1.5.0
(function(){
  console.log('Hello');
}).call(this);

by default.

rhendric commented 6 years ago

Reopened due to regression.