{"action":"created","issue":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/426","repository_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch","labels_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/426/labels{/name}","comments_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/426/comments","events_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/426/events","html_url":"https://github.com/gruntjs/grunt-contrib-watch/issues/426","id":65088939,"number":426,"title":"options.cwd.spawn seems to be ignored","user":{"login":"kfranqueiro","id":398379,"avatar_url":"https://avatars.githubusercontent.com/u/398379?v=3","gravatar_id":"","url":"https://api.github.com/users/kfranqueiro","html_url":"https://github.com/kfranqueiro","followers_url":"https://api.github.com/users/kfranqueiro/followers","following_url":"https://api.github.com/users/kfranqueiro/following{/other_user}","gists_url":"https://api.github.com/users/kfranqueiro/gists{/gist_id}","starred_url":"https://api.github.com/users/kfranqueiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfranqueiro/subscriptions","organizations_url":"https://api.github.com/users/kfranqueiro/orgs","repos_url":"https://api.github.com/users/kfranqueiro/repos","events_url":"https://api.github.com/users/kfranqueiro/events{/privacy}","received_events_url":"https://api.github.com/users/kfranqueiro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2015-03-29T19:44:19Z","updated_at":"2016-12-05T21:29:36Z","closed_at":null,"body":"It seems to me as if `options.cwd.spawn` gets bulldozed by https://github.com/gruntjs/grunt-contrib-watch/blob/v0.6.1/tasks/watch.js#L98-L101, so by the time it gets checked in https://github.com/gruntjs/grunt-contrib-watch/blob/v0.6.1/tasks/lib/taskrun.js#L75, it's no longer defined.  Am I missing something?\n\nContext:  I'm trying to use grunt-contrib-watch in a Gruntfile for a project using atom-shell.  Atom-shell projects seem to advocate a structure where the Gruntfile is within a build directory rather than the project root.  So you end up with something like this:\n\n``` js\nmodule.exports = function (grunt) {\n    // ...\n    grunt.loadNpmTasks('grunt-contrib-watch');\n\n    grunt.file.setBase(require('path').resolve('..'));\n\n    grunt.initConfig({\n        // ...\n        watch: {\n            options: {\n                cwd: {\n                    files: '.',\n                    spawn: './build'\n                }\n            },\n            // ...\n        }\n    });\n\n    // ...\n};\n```\n\nUnfortunately, despite setting `options.cwd.spawn`, as far as I can tell it is still trying to spawn from the base path (which is reset via `grunt.file.setBase` with the intent of allowing files to be matched from outside the `build` folder), and I get the ol' \"unable to find local grunt\" message.\n\n(PS: if I try setting `spawn` and not `files`, I appear to get a lovely infinite recursion.)\n"},"comment":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/comments/264983043","html_url":"https://github.com/gruntjs/grunt-contrib-watch/issues/426#issuecomment-264983043","issue_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/426","id":264983043,"user":{"login":"kevindb","id":3468013,"avatar_url":"https://avatars.githubusercontent.com/u/3468013?v=3","gravatar_id":"","url":"https://api.github.com/users/kevindb","html_url":"https://github.com/kevindb","followers_url":"https://api.github.com/users/kevindb/followers","following_url":"https://api.github.com/users/kevindb/following{/other_user}","gists_url":"https://api.github.com/users/kevindb/gists{/gist_id}","starred_url":"https://api.github.com/users/kevindb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevindb/subscriptions","organizations_url":"https://api.github.com/users/kevindb/orgs","repos_url":"https://api.github.com/users/kevindb/repos","events_url":"https://api.github.com/users/kevindb/events{/privacy}","received_events_url":"https://api.github.com/users/kevindb/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T21:29:36Z","updated_at":"2016-12-05T21:29:36Z","body":"👍 +1 I'm having the same issue"}}
{"actor":{"display_login":"kevindb"}}