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

Multiple --watchDirectory options throws error #134

Closed
alex7071 opened this issue Nov 3, 2016 · 0 comments · Fixed by #136
Closed

Multiple --watchDirectory options throws error #134

alex7071 opened this issue Nov 3, 2016 · 0 comments · Fixed by #136

Comments

@alex7071
Copy link
Contributor

alex7071 commented Nov 3, 2016

This comes from the forever cli project but issue is in the monitor watcher plugin:

Scenario: include multiple --watchDirectory='somepaths' in a forever start command.

Expected: watch multiple directories
Actual: throws exception:
TypeError: Path must be a string. Received [ '/var/www/myproject/services/engine',
'/var/www/myproject/lib/nodejs' ]
at assertPath (path.js:7:11)
at Object.join (path.js:1213:7)
at exports.attach (/usr/local/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/plugins/watch.js:54:20)
at Object.bootstrap (/usr/local/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:36:28)
at exports.App (/usr/local/lib/node_modules/forever/node_modules/broadway/lib/broadway/app.js:47:21)
at new exports.Monitor (/usr/local/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:139:16)
at start (/usr/local/lib/node_modules/forever/bin/monitor:23:17)
at process. (/usr/local/lib/node_modules/forever/bin/monitor:85:5)
at emitTwo (events.js:106:13)
at process.emit (events.js:191:7

It's constructed as a string array as chokidar requests but the watcher plugin throws an exception on line 54 when this.watchDirectory is a string array. It expects a string.

Didn't have time to see if multiple .foreverignore would work, but IMO, the watcher plugin should either iterate through items and use multiple .foreverignore files or use a '.foreverignore' in a single location of the command context instead of the watchDirectory.

LE: watchFilter uses this.watchDirectory too, so that needs fixing as well, so it works with array.

alex7071 added a commit to alex7071/forever-monitor that referenced this issue Dec 1, 2016
kibertoad added a commit that referenced this issue May 8, 2019
Fix for #134 Multiple --watchDirectory options throws error
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

Successfully merging a pull request may close this issue.

1 participant