-
Notifications
You must be signed in to change notification settings - Fork 146
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
Shell: Add option to watch/reload the brain #160
Conversation
Does this do what you think? Try doing something like A long time ago the RiveScript modules arranged data in a hierarchical object tree, like The only good/fast way I can think to fully reload a bot that works this way would be to first clear out all the data and reparse the code from scratch. |
PS: I've merged master back into this branch to keep it up-to-date using Github's UI, but I can properly rebase the pull request if you want. |
@kirsle I've pushed a few more tweaks. Let me know how you feel about this. Thanks! |
fs.watch(opts.brain, {recursive: false}, function() { | ||
console.log(""); | ||
console.log('[INFO] Brain changed, reloading bot.'); | ||
rl.prompt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to require the user to press enter? Is it necessary? I think most watcher things just notify of the reload and continue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope it's just to display the >
input sign again in the terminal's last line. Necessary as we've been writing to the console.log
. No user action needed of any sort.
@kirsle If you like and merge this I will make the same changes to
shell.coffee