Created
September 16, 2022 10:01
-
-
Save TahaBoulehmi/ef9e8f9123e53590bdefc050c6b568ba to your computer and use it in GitHub Desktop.
Export Heroku env
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
// This script lets you export all heroku config vars | |
// 1) Go to your app settings and reveal config vars | |
// 2) Open the console and run this code: | |
// BONUS: You can add this script as a bookmark. | |
function download(filename, text) { | |
var element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); | |
document.body.removeChild(element); | |
} | |
var env = '' | |
Array.from(document.getElementsByTagName('tbody')[0].children).map(item => env += item.children[0].children[0].value + '=' + item.children[1].children[0].value + '\n') | |
download('env.txt', env); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minified:
function download(e,t){var n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}var env="";Array.from(document.getElementsByTagName("tbody")[0].children).map(e=>env+=e.children[0].children[0].value+"="+e.children[1].children[0].value+"\n"),download("env.txt",env);