Skip to content

Instantly share code, notes, and snippets.

@dhoko
Created June 11, 2018 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhoko/9757459132940df466f3bbfdd5257595 to your computer and use it in GitHub Desktop.
Save dhoko/9757459132940df466f3bbfdd5257595 to your computer and use it in GitHub Desktop.
Remove merged branches
{
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