Closed joakin closed 8 years ago
I've found https://github.com/dominictarr/JSON.sh, we could have a json file with the profiles and profile data and read it in bash and do stuff with it.
Another option is converting script/setup
to a node script with shebang, and then server and setup script can share a json file for example.
Another option is converting script/setup to a node script with shebang, and then server and setup script can share a json file for example.
That is my preference. Right now, my priority is a functioning UI, with developer happiness (including documentation) and flexibility a close second and third respectively.
Open to PR about this?
On Fri, Jan 22, 2016, 13:10 Sam Smith notifications@github.com wrote:
Another option is converting script/setup to a node script with shebang, and then server and setup script can share a json file for example.
That is my preference. Right now, my priority is a functioning UI, with developer happiness (including documentation) and flexibility a close second and third respectively.
— Reply to this email directly or view it on GitHub https://github.com/phuedx/micro-device-lab/issues/2#issuecomment-173901325 .
Open to PR about this?
Thanks for the offer but I'm hoping to take cues (and take the time to learn) from joakin/stack – React, webpack, and material-ui.
@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.
1470435 encodes the network throttling profiles in profiles.json
. Converting script/setup
to a Node.js script that reads from that file would be neato!
@joakin I didn't know about child_process.execSync
Iuntil 24 hours ago.
From irc review:
I 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 and in package.json when
npm start
ing:Not 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 withprocess.env
.Is there an easy way to load a JSON file into a bash script?
Any opinions?