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

.watchmanconfig changes not picked up - possible solution #19

Open
benallfree opened this issue Nov 18, 2017 · 1 comment
Open

.watchmanconfig changes not picked up - possible solution #19

benallfree opened this issue Nov 18, 2017 · 1 comment

Comments

@benallfree
Copy link

benallfree commented Nov 18, 2017

I see this from the watchman docs:

Changes to the .watchmanconfig or /etc/watchman.json files are not picked up automatically; you will need to remove and re-add the watch (for .watchmanconfig) or restart watchman (for /etc/watchman.json) for those changes to take effect.

In order to get config changes picked up, I have to do a watchman watch-del /path/to/my/root and then I can call wml s again.

My question is... is there any harm in wml s doing an auto watch-del first? What would be the downside to this?

@benallfree
Copy link
Author

benallfree commented Nov 18, 2017

PS, this simple change to watchProject seems to do the trick of re-creating the watch each time, thus picking up any .watchmanconfig changes:

'use strict';

var Q = require('q');

module.exports = function (params) {
	var deferred = Q.defer();

	params.client.command(['watch-del', params.src], (error, resp) => {
		if (error) {
			deferred.reject(error);
		} else {
			params.client.command(['watch-project', params.src], (error, resp) => {
				if (error) {
					deferred.reject(error);
				} else {
					deferred.resolve(resp);
				}
		
			});
		}

	});


	return deferred.promise;
}

qkdreyer pushed a commit to Triotech-fr/wml that referenced this issue Feb 19, 2018
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