Skip empty excludes

This is useful when you want to append additional elements to the env
var in the fasion of `PATH=$PATH:/things`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2019-09-10 16:33:44 -04:00
parent e7e08e6b9b
commit efe06dd0d3
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ func Check(commit string) ([]byte, error) {
if gitNewEnough {
excludeList := strings.Split(excludeEnvList, ":")
for _, exclude := range excludeList {
if exclude == "" {
continue
}
args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude))
}
}