Created
February 12, 2018 06:00
-
-
Save nmnp/f2f1fa3bf2902837267cee9dbef7054e to your computer and use it in GitHub Desktop.
Generate JSON string of environment variables of a wercker pipeline
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
var envVar = {}; | |
var tr = Array.from( | |
document.querySelectorAll("table")[0].querySelectorAll('tbody')[0].querySelectorAll('tr')); | |
tr.map((el)=>{ | |
var tmp = []; | |
tmp[el.querySelectorAll('.envvarItem_key')[0].querySelectorAll('input')[0].value] = el.querySelectorAll('td')[1].querySelectorAll('.envvarItem_value')[0].querySelectorAll('.envvarItem_value_container')[0].querySelectorAll('textarea')[0].value; | |
envVar = Object.assign(envVar, tmp); | |
} | |
); | |
console.log(JSON.stringify(envVar)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment