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

Windows 10 non existent folders causes onchange to fail #50

Closed
alex-page opened this issue Aug 9, 2017 · 9 comments
Closed

Windows 10 non existent folders causes onchange to fail #50

alex-page opened this issue Aug 9, 2017 · 9 comments

Comments

@alex-page
Copy link

alex-page commented Aug 9, 2017

When running onchange in windows 10 I can get the function to work when I have the app directory:
onchange \"app/**/*.js\" -- npm test

However it doesn't work when I have the app directory but not the test directory:
onchange \"app/**/*.js\" \"test/**/*.js\" -- npm test

There seems to be an issue with non existent folders when using onchange on Windows 10.

@alex-page alex-page changed the title Windows multiple glob patterns doesn't work with escaped quotations Windows non existent folders causes onchange to fail Aug 9, 2017
@alex-page alex-page changed the title Windows non existent folders causes onchange to fail Windows 10 non existent folders causes onchange to fail Aug 9, 2017
@blakeembrey
Copy link
Collaborator

Have you tried single quotes? I don't use Window personally, but I know there's some oddities. On another note, I'd just recommend combining them in a glob pattern: {app,test}/**/*.js.

@alex-page
Copy link
Author

alex-page commented Aug 9, 2017

I did try single quotes, that doesn't work at all. There is documentation about the quotes in the readme.md:

NOTE: Windows users may need to use double quotes rather than single quotes. If used in an npm script, remember to escape the double quotes.

I am not sure if I can combine them in a glob pattern like you recommend as my actual code looks more like this:
"watch:sass": "npm run build && onchange \"src/sass/*.scss\" \"tests/docs/*.scss\" -- npm run build"

Noting that I have files that match this pattern src/sass/*.scss and do not have the tests directory.

@blakeembrey
Copy link
Collaborator

You can do {src/sass,tests/docs}/*.scss instead. Seems like an odd issue, hopefully someone else can come along to provide more light on the issue.

@blakeembrey
Copy link
Collaborator

Oh, I misread the issue too - this is specifically when starting the command and the directory doesn't exist? What's the error? This looks like something we should log in chokidar.

@blakeembrey
Copy link
Collaborator

Does this sound related: paulmillr/chokidar#346?

@alex-page
Copy link
Author

It's definitely that issue cheers mate.

@blakeembrey
Copy link
Collaborator

Ok, so you can do onchange --poll to enable polling. Does that improve things?

@alex-page
Copy link
Author

I did try --poll but it still failed silently in windows when the directory doesn't exist.

For instance I made changes in src/sass/*.scss and even with --poll on it refused to refresh if the tests directory was non existent.

@alex-page
Copy link
Author

I'm going to close this issue as it's related to chokidar.

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

2 participants