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

Immediate exit without warning if a path doesn't exist #183

Open
zakdances opened this issue Aug 16, 2013 · 5 comments
Open

Immediate exit without warning if a path doesn't exist #183

zakdances opened this issue Aug 16, 2013 · 5 comments
Milestone

Comments

@zakdances
Copy link

If have watch (v.0.5.1) configured like this

watch:
  sass:
    files: ['fakeDir/*.scss']
    tasks: ['sass:dev']
    options:
      nospawn: false
      livereload: false

And I try grunt watch, the terminal prints out

MyProject zak$ grunt watch
Running "watch:sass" (watch) task
Waiting...MyProject zak$

Why doesn't watch print a message like

"ERROR: 'fakeDir/' doesn't exist. Exiting..."

?

@shama
Copy link
Member

shama commented Aug 16, 2013

If you enabled the option nonull: true it should give you a warning about non-existent files. Although I think it would be a good idea to print a warning if no files are being watched at the time.

@courajs
Copy link

courajs commented Sep 12, 2013

👍
I spent 20 mins trying to figure out why it was exiting immediately (I forgot a leading slash)
The nonull option is also not documented anywhere...
Would you accept a PR to fix this?

@shama
Copy link
Member

shama commented Sep 12, 2013

@FellowMD nonull is common to all grunt plugins, see http://gruntjs.com/configuring-tasks#files

@courajs
Copy link

courajs commented Sep 12, 2013

Ah that link is helpful -- I'm a bit new to grunt.
Still, I had no idea why it was exiting. This might be solved with an entry in the FAQ "Why does my watch task exit immediately?", or with a message when no targets have any files/directories to watch.
I don't think it's clear or obvious that a watch task without a target would exit, instead of just doing nothing forever, or perhaps running when that file is created.

@shama
Copy link
Member

shama commented Sep 12, 2013

I think we should have it print a message if the watch doesn't match any files. Also keep the process alive as it could be waiting for new files to be added.

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

3 participants