{"action":"created","issue":{"url":"https://api.github.com/repos/phuedx/micro-device-lab/issues/2","labels_url":"https://api.github.com/repos/phuedx/micro-device-lab/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/phuedx/micro-device-lab/issues/2/comments","events_url":"https://api.github.com/repos/phuedx/micro-device-lab/issues/2/events","html_url":"https://github.com/phuedx/micro-device-lab/issues/2","id":128141558,"number":2,"title":"Share flow ids between the node process and the setup script","user":{"login":"joakin","id":657839,"avatar_url":"https://avatars.githubusercontent.com/u/657839?v=3","gravatar_id":"","url":"https://api.github.com/users/joakin","html_url":"https://github.com/joakin","followers_url":"https://api.github.com/users/joakin/followers","following_url":"https://api.github.com/users/joakin/following{/other_user}","gists_url":"https://api.github.com/users/joakin/gists{/gist_id}","starred_url":"https://api.github.com/users/joakin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakin/subscriptions","organizations_url":"https://api.github.com/users/joakin/orgs","repos_url":"https://api.github.com/users/joakin/repos","events_url":"https://api.github.com/users/joakin/events{/privacy}","received_events_url":"https://api.github.com/users/joakin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-22T11:53:52Z","updated_at":"2016-01-22T18:15:39Z","closed_at":null,"body":"From irc review:\r\n\r\n> I think it is worth sharing the profile ids between the node process and the bash script somehow https://github.com/phuedx/micro-device-lab/blob/dev/src/profiles.js#L8-L13 so that you don't have to implicitly keep them in sync the ids with the setup script ones.\r\n\r\nI think the easiest way would be a script that exports the profiles and ids as environment variables, such script would get called at the beginning of [script/setup](https://github.com/phuedx/micro-device-lab/blob/dev/script/setup) and in [package.json](https://github.com/phuedx/micro-device-lab/blob/dev/package.json#L3) when `npm start`ing:\r\n\r\n```json\r\n  \"scripts\": {\r\n    \"start\": \"./scripts/env && node index.js\"\r\n  }\r\n```\r\n\r\n```diff\r\n cd \"$(dirname \"$0\")/..\"\r\n\r\n+script/env\r\n script/bootstrap\r\n```\r\n\r\nNot exactly sure about that `script/env` would set. I know there's bash dictionaries but I'm not sure how those would be read in node with `process.env`.\r\n\r\nIs there an easy way to load a JSON file into a bash script?\r\n\r\nAny opinions?"},"comment":{"url":"https://api.github.com/repos/phuedx/micro-device-lab/issues/comments/173997989","html_url":"https://github.com/phuedx/micro-device-lab/issues/2#issuecomment-173997989","issue_url":"https://api.github.com/repos/phuedx/micro-device-lab/issues/2","id":173997989,"user":{"login":"joakin","id":657839,"avatar_url":"https://avatars.githubusercontent.com/u/657839?v=3","gravatar_id":"","url":"https://api.github.com/users/joakin","html_url":"https://github.com/joakin","followers_url":"https://api.github.com/users/joakin/followers","following_url":"https://api.github.com/users/joakin/following{/other_user}","gists_url":"https://api.github.com/users/joakin/gists{/gist_id}","starred_url":"https://api.github.com/users/joakin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakin/subscriptions","organizations_url":"https://api.github.com/users/joakin/orgs","repos_url":"https://api.github.com/users/joakin/repos","events_url":"https://api.github.com/users/joakin/events{/privacy}","received_events_url":"https://api.github.com/users/joakin/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T18:15:39Z","updated_at":"2016-01-22T18:15:39Z","body":"@phuedx Sure! I think I wasn't clear enough, I was asking if you'd be interested in a PR about sharing profiles and IDs in setup and server."}}