Created
May 4, 2018 07:23
-
-
Save benjaminW78/67733c4ebe0f0d2acf5a364d0b43b93d to your computer and use it in GitHub Desktop.
aws elastic beanstalk variable env extract to string
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
const acc=[] | |
tableRoot = document.querySelector('table.properties-table') | |
.querySelectorAll('tbody>tr.ng-scope:not(.ng-hide)>td>input[type="text"]') | |
.forEach(( current,index) => { | |
if (index % 2 === 0) { | |
acc.push({}) | |
acc[acc.length - 1].name = current.value | |
} else { | |
acc[acc.length - 1].value = current.value | |
} | |
}, []) | |
acc.reduce((acc,item)=>{return acc+=item.name+'='+item.value+'\n'},'') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment