refs #5901 Bugs solved
This commit is contained in:
parent
66192f2505
commit
556937ff48
6
main.js
6
main.js
|
@ -1,4 +1,4 @@
|
|||
require('simple-git');
|
||||
const simpleGit = require('simple-git');
|
||||
const { promisify } = require('util');
|
||||
|
||||
// Local path of the git repository
|
||||
|
@ -12,9 +12,9 @@ async function main() {
|
|||
try {
|
||||
await git.fetch(['--prune']);
|
||||
let branches = (await gitBranch(['-r', '--merged', 'HEAD'])).all;
|
||||
const trunkBranches = ["test", "master", "dev"];
|
||||
const excludedBranches = ['test', 'master', 'dev'];
|
||||
branches = branches.map((branch) => {return branch.substring(7, branch.length)});
|
||||
branches = branches.filter((element) => !trunkBranches.includes(element));
|
||||
branches = branches.filter((element) => !excludedBranches.includes(element));
|
||||
|
||||
for (let branch of branches) {
|
||||
await gitPush(['origin', '--delete', branch]);
|
||||
|
|
Loading…
Reference in New Issue