Quantcast
Channel: User totymedli - Stack Overflow
Viewing all articles
Browse latest Browse all 54

Answer by totymedli for How to rename .env variables in package.json?

$
0
0

tl;dr

If the package you try to configure has the ability to do configuration via a JavaScript file, you can add the renaming at the beginning of it:

process.env.PERCY_TOKEN = process.env.CYPRESS_PERCY_SALESFORCE_TOKEN;

Explanation

While this isn't the solution I was looking for, it is a workaround for this specific use case. Percy supports JavaScript config files so I migrated my YAML config file, then I logged process.env and the .env file's variables were there, so I just need to copy the correct one. This might work for other packages that support JavaScript config files (or some alternative kind of hook/preloader where custom code can be placed), but if they don't, then the question is still unanswered.


Viewing all articles
Browse latest Browse all 54

Trending Articles