{"action":"created","issue":{"url":"https://api.github.com/repos/kentcdodds/cross-env/issues/167","repository_url":"https://api.github.com/repos/kentcdodds/cross-env","labels_url":"https://api.github.com/repos/kentcdodds/cross-env/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/kentcdodds/cross-env/issues/167/comments","events_url":"https://api.github.com/repos/kentcdodds/cross-env/issues/167/events","html_url":"https://github.com/kentcdodds/cross-env/issues/167","id":295731819,"number":167,"title":"cross-env eats backslashes","user":{"login":"greggman","id":234804,"avatar_url":"https://avatars2.githubusercontent.com/u/234804?v=4","gravatar_id":"","url":"https://api.github.com/users/greggman","html_url":"https://github.com/greggman","followers_url":"https://api.github.com/users/greggman/followers","following_url":"https://api.github.com/users/greggman/following{/other_user}","gists_url":"https://api.github.com/users/greggman/gists{/gist_id}","starred_url":"https://api.github.com/users/greggman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greggman/subscriptions","organizations_url":"https://api.github.com/users/greggman/orgs","repos_url":"https://api.github.com/users/greggman/repos","events_url":"https://api.github.com/users/greggman/events{/privacy}","received_events_url":"https://api.github.com/users/greggman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-09T02:10:43Z","updated_at":"2018-03-08T20:29:27Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThanks for your interest in the project. I appreciate bugs filed and PRs submitted!\r\nPlease make sure that you are familiar with and follow the Code of Conduct for\r\nthis project (found in the CODE_OF_CONDUCT.md file).\r\n\r\nPlease fill out this template with all the relevant information so we can\r\nunderstand what's going on and fix the issue.\r\n\r\nI'll probably ask you to submit the fix (after giving some direction). If you've\r\nnever done that before, that's great! Check this free short video tutorial to\r\nlearn how: http://kcd.im/pull-request\r\n-->\r\n\r\n- `cross-env` version: 5.1.3\r\n- `node` version: 8.9.4\r\n- `npm` (or `yarn`) version: 5.6.0\r\n\r\nRelevant code or config, in package.json\r\n\r\n```\r\n{\r\n  \"name\": \"test-cross-env\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"main\": \"index.js\",\r\n  \"scripts\": {\r\n    \"test1\": \"cross-env TEST=foo node main.js\",\r\n    \"test2\": \"node main.js\"\r\n  },\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\",\r\n  \"devDependencies\": {\r\n    \"cross-env\": \"^5.1.3\"\r\n  }\r\n}\r\n```\r\n\r\nmain.js\r\n\r\n```\r\nconsole.log(process.argv.join(' '));\r\n```\r\n\r\n\r\nWhat you did:\r\n\r\npassed `\\\\someshare\\somefolder` through cross-env\r\n\r\n\r\nWhat happened:\r\n\r\ncross-env ate a backslash\r\n\r\n<!-- Please provide the full error message/screenshots/anything -->\r\n\r\n```\r\nC:\\Users\\gregg\\temp>npm run test1 \\\\someshare\\somefolder\r\n\r\n> test-cross-env@1.0.0 test1 C:\\Users\\gregg\\temp\r\n> cross-env TEST=foo node main.js \"\\\\someshare\\somefolder\"\r\n\r\nC:\\Program Files\\nodejs\\node.exe C:\\Users\\gregg\\temp\\main.js \\someshare\\somefolder\r\n\r\nC:\\Users\\gregg\\temp>npm run test2 \\\\someshare\\somefolder\r\n\r\n> test-cross-env@1.0.0 test2 C:\\Users\\gregg\\temp\r\n> node main.js \"\\\\someshare\\somefolder\"\r\n\r\nC:\\Program Files\\nodejs\\node.exe C:\\Users\\gregg\\temp\\main.js \\\\someshare\\somefolder\r\n```\r\n\r\nReproduction repository:\r\n\r\nsee above\r\n\r\n\r\nProblem description:\r\n\r\n\r\ncross-env eats backslashes. Not going through cross-env the backslashes make it into the program being excecuted\r\n\r\nYou can't even escape them with more backslashes\r\n\r\n```\r\nC:\\Users\\gregg\\temp>npm run test1 \\\\\\\\someshare\\somefolder\r\n\r\n> test-cross-env@1.0.0 test1 C:\\Users\\gregg\\temp\r\n> cross-env TEST=foo node main.js \"\\\\\\\\someshare\\somefolder\"\r\n\r\nC:\\Program Files\\nodejs\\node.exe C:\\Users\\gregg\\temp\\main.js \\someshare\\somefolder\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kentcdodds/cross-env/issues/comments/371614280","html_url":"https://github.com/kentcdodds/cross-env/issues/167#issuecomment-371614280","issue_url":"https://api.github.com/repos/kentcdodds/cross-env/issues/167","id":371614280,"user":{"login":"rob3c","id":1098077,"avatar_url":"https://avatars1.githubusercontent.com/u/1098077?v=4","gravatar_id":"","url":"https://api.github.com/users/rob3c","html_url":"https://github.com/rob3c","followers_url":"https://api.github.com/users/rob3c/followers","following_url":"https://api.github.com/users/rob3c/following{/other_user}","gists_url":"https://api.github.com/users/rob3c/gists{/gist_id}","starred_url":"https://api.github.com/users/rob3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob3c/subscriptions","organizations_url":"https://api.github.com/users/rob3c/orgs","repos_url":"https://api.github.com/users/rob3c/repos","events_url":"https://api.github.com/users/rob3c/events{/privacy}","received_events_url":"https://api.github.com/users/rob3c/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T20:29:27Z","updated_at":"2018-03-08T20:29:27Z","author_association":"NONE","body":"Normally, you pass args to npm scripts via `--`, as shown in the npm docs here:\r\n\r\nhttps://docs.npmjs.com/cli/run-script\r\n\r\nOtherwise, you're just passing the args to `npm`, not your script. If they make it through somehow, then you probably got lucky.\r\n\r\nHave you tried the documented way like this?:\r\n```\r\n> npm run test1 -- \\\\someshare\\somefolder\r\n```"}}
{"actor":{"display_login":"rob3c"}}