I have a package.json that has the following script:
"scripts": {
"config": ". ./setup.sh"
},
The setup.sh file prompts the user for an API token,
read -p "Enter API Authorization Token: " val
export API_AUTH_TOKEN=$val
and an environment via a PS3 menu. Ex: entering 1 should export DEFAULT_ENV='http://localhost:8000'.
And when I run this setup.sh via the terminal(. ./setup.sh), it works great. It's only when I run "npm run config", where it doesn't actually export those values, although it acts like it did. I'm under the impression this is related to this script being a process within the other process, and so, not affecting the global environment. How do I make it so that it does?