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

Cannot watch recursively inside dotfolder (.git/**/*) #331

Open
orty opened this issue Sep 4, 2019 · 1 comment
Open

Cannot watch recursively inside dotfolder (.git/**/*) #331

orty opened this issue Sep 4, 2019 · 1 comment

Comments

@orty
Copy link

orty commented Sep 4, 2019

Hi,

I am trying to develop a custom archiver service using gulp-watch and 7zip-min. I am lookig for a way to watch recursively a list of paths (to folders or specific files) which could contain hidden files/folders or even dotfiles/dotfolders.

An example is the folder in which I keep all my git repositories :
C:/Users/{user-id}/.gitglobal/{project-name}/.git/....

So for this one, I add to my watched list the following globs :
'C:/Users/{user-id}/.gitglobal/**/*', 'C:/Users/{user-id}/.gitglobal/**/.*', 'C:/Users/{user-id}/.gitglobal/**/.**/**/*', 'C:/Users/{user-id}/.gitglobal/**/.**/**/.*'

and the following options for gulp-watch
return watch(backupList, { ignoreInitial: false, read: false, dot: true, base: 'c:/' })
But the files deeper than C:/Users/{user-id}/.gitglobal/{project-name}/.git/XXX are never detected by the gulp-watch, like :
C:/Users/{user-id}/.gitglobal/Project1/.git/logs/refs/heads and so on..

I really want my service to be as generic as possible, and be able to provide any kind of path to it.

FYI, I tried to output a minimatch result of the file given in example before, and it matches one of my globs. What did I missed ?

Thank you.

@orty orty changed the title Cannpt watch recursively inside dotfolder (.git/**/*) Cannot watch recursively inside dotfolder (.git/**/*) Sep 4, 2019
@orty
Copy link
Author

orty commented Sep 5, 2019

Quick update : as gulp-watch relies on chokidar I just tried to refactor my code using directly chokidar.watch and it worked down to C:\Users\{user-id}\.gitglobal\Project1\.git\logs\HEAD but not deeper.
And I have trouble to make the event callback work asynchronously (as I have to wait for 7zip to finish zipping the file) so I think I really need glup-watch to achieve my goal.

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