1
0
Fork 0
mirror of https://github.com/vbatts/git-validation.git synced 2024-11-22 16:15:40 +00:00

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

View file

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