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

Not able to run an async task from callback of gulp-prompt #68

Open
akanshgulati opened this issue Jun 18, 2019 · 0 comments
Open

Not able to run an async task from callback of gulp-prompt #68

akanshgulati opened this issue Jun 18, 2019 · 0 comments

Comments

@akanshgulati
Copy link

gulp.task("watch-confirm", function(done) {
  return gulp.src(web_app_dir).pipe(
    $.prompt.prompt(
      {
        type: "confirm",
        message: `Current tomcat root dir -> ${tomcat_root_dir}, continue?`,
        default: true,
        name: "start"
      },
      function(res) {
        if (res.start) {
          gulp.series("watch");
        } else {
         
          done();
        }
      }
    )
  );
});

The task, watch is async and watches the changes in the file using gulp-watch and run tasks within on the change of JS or CSS. But, once I confirm, I am not getting that 'watch' task is finished.

If I start the watch task from within the callback of the prompt, I get following response:
Screen Shot 2019-06-18 at 4 13 17 PM

But, when I try to run the same task from the command line, I get the correct response. Any idea what basically I have to do in this case? Not sure if spawning will help.
Screen Shot 2019-06-18 at 4 13 45 PM

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