Last active
May 23, 2019 04:01
-
-
Save klauszhang/558662b2476e51796f6fe461def25bae to your computer and use it in GitHub Desktop.
Extract aws config from eb
This file contains 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
const val = Array.from(document.getElementsByTagName('tbody')[1].children) | |
.filter(ele => ele.className === 'ng-scope') | |
.map(element => ({ | |
[element.children[0].children[0].value]: | |
element.children[1].children[0].value, | |
})) | |
.filter(value => Object.keys(value)[0]) | |
.reduce((curr, acc) => ({ ...curr, ...acc }), {}) | |
JSON.stringify(val) | |
// adding the following will make it useable for bash | |
Object.keys(val).reduce((result, key)=>(`${result}${key}=${val[key]}\n`), '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stay on config page and run the script