I've been having a really hard time to get Bun to read environment variables.
I have this bunfig.toml:
[install.registry]
url = "https://artifacts.company.io/artifactory/api/npm/npm-virtual/:_auth=$ARTIFACTORY_NPM_SECRET"
This will not work regardless of the fact that the environment variable is set:
echo $ARTIFACTORY_NPM_SECRET
c3R....
I also tried putting it in .env either like this:
ARTIFACTORY_NPM_SECRET=c3R...
Or like this:
ARTIFACTORY_NPM_SECRET=${ARTIFACTORY_NPM_SECRET}
But neither of the above works.
I have confirmed that if I hard code the variable in bunfig it does work. I just need Bun to read the (preferably) actual environment variable (from process.env).
This works, but I can't use it:
[install.registry]
url = "https://artifacts.company.io/artifactory/api/npm/npm-virtual/:_auth=c3R..."