gkz/LiveScript — pull request #327 by dtinth (2013-06-18 14:00:04+00:00)
Title: require 'prelude-ls' when loading the CLI. Makes -d work when LiveScript is installed globally.

Using Node.js v0.10.5, running a globally installed LiveScript using `lsc -id` (interactive + require prelude) throws this error.

~~~
module.js:340
throw err;
^
Error: Cannot find module 'prelude-ls'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at repl (/Users/dttvb/github/LiveScript/lib/command.js:321:23)
at Object. (/Users/dttvb/github/LiveScript/lib/command.js:89:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
~~~

I make 'command.ls' require 'prelude-ls' at the top instead as on demand, I don't know why, but that fixed it. Running `lsc -id` now works:

~~~
▹ lsc -id
livescript> id
[Function]
function (x){
return x;
}
livescript>
~~~