Created
June 11, 2018 13:52
-
-
Save dhoko/9757459132940df466f3bbfdd5257595 to your computer and use it in GitHub Desktop.
Remove merged branches
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 list = $$('.js-branch-row'); | |
const toRemove = list.filter((node) => { | |
return node.querySelector('.State--purple'); | |
}); | |
toRemove.forEach((node) => { | |
node.querySelector('.State--purple').textContent = 'DONE' | |
}); | |
if (!toRemove.length) { | |
console.log('---- Nothing to remove ----'); | |
} | |
if (toRemove.length && window.confirm('Is it ok ?')) { | |
toRemove.forEach((node) => { | |
node.querySelector('.branch-delete').click(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment