Skip to content
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

How to auto restart vorpal after any change to source code? #357

Open
fuads96 opened this issue Dec 30, 2021 · 0 comments
Open

How to auto restart vorpal after any change to source code? #357

fuads96 opened this issue Dec 30, 2021 · 0 comments

Comments

@fuads96
Copy link

fuads96 commented Dec 30, 2021

I have an application:

$ node src/app.js

myapp~$ init --username fuads96 --password 12345678
   App is ready.

myapp/@fuads96~$ 

The problem here is every time I change my source code, I have to exit current vorpal instance and restart it with the same command again.

How to restart automatically?

perhaps I need something like nodemon for node.

SOLUTION

I created a new pull request to add a new option named once to the vorpal.parse() method to solve this problem.

Then we can use nodemon to watch destination source code and restart vorpal app with the init command:

vorpal
   .parse(process.argv, { once: true })
   .show();
// package.json
...
scripts: {
   "start": "nodemon --watch dist --exec \"init --username fuads96 --password 12345678\" "
}
@fuads96 fuads96 changed the title How to auto restart vorpal instance with a default command? How to auto restart vorpal after any change to source code? Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant