Created
October 26, 2018 19:33
-
-
Save thiamsantos/b63ebe9006ff1e5f3ecbe20ade6a28c7 to your computer and use it in GitHub Desktop.
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
valid_branchs = [ | |
"master" | |
] | |
"git" | |
|> System.cmd(["branch"]) | |
|> elem(0) | |
|> String.split("\n") | |
|> Enum.map(&String.trim/1) | |
|> Enum.reject(&match?("", &1)) | |
|> Enum.reject(&String.starts_with?(&1, "*")) | |
|> Enum.reject(&Enum.member?(valid_branchs, &1)) | |
|> Enum.each(fn branch -> | |
"git" | |
|> System.cmd(["branch", "-D", branch]) | |
|> IO.inspect() | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment