-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't use global with nesh #3
Comments
This definitely seems like it should work and I can confirm that it doesn't. I'm not sure why as the nesh = require 'nesh'
foo1 = 1
foo2 = 'something'
foo3 = new ...
nesh.loadLanguage 'coffee'
nesh.start prompt: 'nesh> ', (err, repl) ->
if err then return nesh.log.error(err)
repl.context.foo1 = foo1
repl.context.foo2 = foo2
repl.context.foo3 = foo3 This way you can expose objects and let users interact with them one by one. If you have a If you find yourself needing this often it would be relatively easy to write a plugin that does this during the Hope this helps. |
I believe the changes proposed in #4 will fix this issue. They require upstream changes to work with Coffeescript though, so I don't have a timeframe for implementation. See #4 and jashkenas/coffeescript#3113 for more info. |
It looks like this is fixed with CoffeeScript 1.7 - feel free to update ( |
It is fixed, yay! Thanks! |
Closing as it's fixed with an upstream update. |
I don't know if this is a problem with nesh, or user error, but when I start nesh with the option useGlobal: true (which is one of the options for repl) it doesn't work any more. Here is my test code:
And here is my output:
What I am trying to do is run nesh with the same context as the main program so I can interact with the objects in node through nesh just like I would interact with ActiveRecord objects through the rails console. Is this possible? What am I doing wrong?
The text was updated successfully, but these errors were encountered: