-
-
Save pntech20/5f06058b85de089ee86106dc0a58052e to your computer and use it in GitHub Desktop.
Get/Export Vercel envs script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(async () => { | |
| const TIMEOUT_MS = 700 | |
| const delay = () => new Promise((resolve) => setTimeout(resolve, TIMEOUT_MS)) | |
| const revealButtons = document.querySelectorAll('button[aria-label="Click to reveal"]') | |
| for (revealButton of revealButtons) { | |
| revealButton.click() | |
| await delay() | |
| } | |
| await delay() | |
| const envKeys = [...document.querySelectorAll('span > span[class*="env-variables-"]')].map((key) => key.textContent) | |
| const enValues = [...document.querySelectorAll('button > code[class*="env-var-value"]')].map((key) => key.textContent) | |
| const envs = envKeys.reduce((acc, key, index) => { | |
| envKeys[index] = enValues[index] | |
| acc += `${key}="${enValues[index]}"\n` | |
| return acc | |
| }, '') | |
| console.log(envs) | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment