forever: .foreverignore file not working for sub directories with -w
Normal ignore rules don’t seem to work correctly with forever. I was trying to add my .git folder and was unable to get it working. I tried with the below file.
.git
.git/
.git/*
The first line is the only one that should be needed.
If you did a git pull and a file changed in the .git folder forever would restart.
info: restaring script because /mnt/home/test/.git/FETCH_HEAD changed
warn: Forever detected script exited with code: null
warn: Forever restarting script for 1 time
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 47 (6 by maintainers)
Commits related to this issue
- closes #164 and #235 fix wrong usage of matchBase option of minimatch, use relative to watchDirectory path fore matching — committed to skimcom/forever by kof 12 years ago
- closes #164 and #235 fix wrong usage of matchBase option of minimatch, use relative to watchDirectory path fore matching — committed to foreversd/forever by kof 12 years ago
- [test] Add (passing) tests for https://github.com/foreverjs/forever/issues/235. Issue must be in forever somehow. — committed to foreversd/forever-monitor by indexzero 9 years ago
I love forever, and have used the CLI for many years in many projects. The developers deserve enormous credit.
Now, I’m using v0.15.3 and in my case, ignored subdirectories are being watched. This has been so for years, and I’ve come back to this thread a half dozen times over the past 4-5 years.
I think the following sums up the situation: (i) The maintainers seemed to regard the problem with the CLI as fixed before it worked the way the users above wanted. (ii) There’s no test in place that covers the way the users above want the CLI to work.
The following demonstrates the the CLI does not respect
.foreverignore
subdirectories, exactly as OP described (paste into terminal):$ forever list
will show a running process. Now we’ll change a file that lives infoo/bar
(paste into terminal):The process should not have restarted, but the log file will indicate that it did so:
If I’m doing something wrong here, please indicate how I should change what I’m doing; I’ll be grateful.
**/.git/**
is working for me in.foreverignore
with v0.11.1It’s a bug in
plugins/watch.js
watchFilter() calls minimatch this way:
But minimatch doesn’t use
matchBase
as a base path, it’s a boolean argument. So minimatch matches pattern against full file path.You can workaround it for now, using
But this should be fixed, surely.