{"action":"opened","issue":{"url":"https://api.github.com/repos/wix/detox/issues/886","repository_url":"https://api.github.com/repos/wix/detox","labels_url":"https://api.github.com/repos/wix/detox/issues/886/labels{/name}","comments_url":"https://api.github.com/repos/wix/detox/issues/886/comments","events_url":"https://api.github.com/repos/wix/detox/issues/886/events","html_url":"https://github.com/wix/detox/issues/886","id":350707958,"node_id":"MDU6SXNzdWUzNTA3MDc5NTg=","number":886,"title":"Error when running \"detox test\" for windows using detox 8 due to findstr not supporting /s in regex","user":{"login":"dat00ste","id":39184419,"node_id":"MDQ6VXNlcjM5MTg0NDE5","avatar_url":"https://avatars2.githubusercontent.com/u/39184419?v=4","gravatar_id":"","url":"https://api.github.com/users/dat00ste","html_url":"https://github.com/dat00ste","followers_url":"https://api.github.com/users/dat00ste/followers","following_url":"https://api.github.com/users/dat00ste/following{/other_user}","gists_url":"https://api.github.com/users/dat00ste/gists{/gist_id}","starred_url":"https://api.github.com/users/dat00ste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dat00ste/subscriptions","organizations_url":"https://api.github.com/users/dat00ste/orgs","repos_url":"https://api.github.com/users/dat00ste/repos","events_url":"https://api.github.com/users/dat00ste/events{/privacy}","received_events_url":"https://api.github.com/users/dat00ste/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-15T07:08:09Z","updated_at":"2018-08-15T07:08:09Z","closed_at":null,"author_association":"NONE","body":"\r\n#### Description\r\nWhen running detox test with detox 8 I get the following error:\r\n\r\ndetox[7016] INFO:  [DetoxServer.js] server listening on localhost:56121...\r\ndetox[7016] ERROR: [exec.js/EXEC_FAIL, #1] \"C:\\Users\\stina.emrikstrand\\AppData\\Local\\Android\\sdk\\platform-tools\\adb -s emulator-5554 shell dumpsys power | findstr /R /C:\"^\\s*m[UW].*=\"\" failed with code = 1, stdout and stderr:\r\n\r\ndetox[7016] ERROR: [exec.js/EXEC_FAIL, #1]\r\ndetox[7016] ERROR: [exec.js/EXEC_FAIL, #1]\r\ndetox[7016] ERROR: [index.js/DETOX_INIT_ERROR]\r\n { ChildProcessError: Command failed: C:\\Users\\stina.emrikstrand\\AppData\\Local\\Android\\sdk\\platform-tools\\adb -s emulator-5554 shell dumpsys power | findstr /R /C:\"^\\s*m[UW].*=\"\r\n `C:\\Users\\stina.emrikstrand\\AppData\\Local\\Android\\sdk\\platform-tools\\adb -s emulator-5554 shell dumpsys power | findstr /R /C:\"^\\s*m[UW].*=\"` (exited with error code 1)\r\n    at callback (C:\\Users\\stina.emrikstrand\\code\\App\\powerup\\node_modules\\child-process-promise\\lib\\index.js:33:27)\r\n    at ChildProcess.exithandler (child_process.js:295:5)\r\n    at ChildProcess.emit (events.js:182:13)\r\n    at maybeClose (internal/child_process.js:962:16)\r\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:249:5)\r\n\r\nI have located the problem to that windows _findstr_ does not support /s in regex. If I replace the line:\r\n\r\n_const stdout = await this.shell(deviceId, `dumpsys power | ${grep('^\\\\s*m[UW].*=')}`);_\r\n\r\nwith \r\n \r\n_const stdout = await this.shell(deviceId, `dumpsys power | ${grep('^ *m[UW].*=')}`);_\r\n\r\nin detox/src/devices/android/ADB.js, it seems to work, for windows at least. I'm not sure about other OS, and since I'm not a developer I'm not sure this is the best way of solving it either :)\r\n\r\n#### Detox, Node, Device, Xcode and macOS Versions\r\n\r\n* Detox: 8.1.6\r\n* React Native: 0.55.3\r\n* Node: 10.8.0\r\n\r\n"}}
{"actor":{"display_login":"dat00ste"}}