mirror of
https://github.com/vbatts/git-validation.git
synced 2024-11-17 13:58:39 +00:00
main: Explicit -range implies -no-travis
If someone went through the trouble to set -range, they probably don't want you clobbering their value with something from a TRAVIS_* environment variable.
This commit is contained in:
parent
206708c3bd
commit
0e135a4759
1 changed files with 8 additions and 6 deletions
14
main.go
14
main.go
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
flCommitRange = flag.String("range", "", "use this commit range instead")
|
||||
flCommitRange = flag.String("range", "", "use this commit range instead (implies -no-travis)")
|
||||
flListRules = flag.Bool("list-rules", false, "list the rules registered")
|
||||
flRun = flag.String("run", "", "comma delimited list of rules to run. Defaults to all.")
|
||||
flVerbose = flag.Bool("v", false, "verbose")
|
||||
|
@ -48,11 +48,13 @@ func main() {
|
|||
}
|
||||
|
||||
var commitRange = *flCommitRange
|
||||
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
|
||||
if os.Getenv("TRAVIS_COMMIT_RANGE") != "" {
|
||||
commitRange = os.Getenv("TRAVIS_COMMIT_RANGE")
|
||||
} else if os.Getenv("TRAVIS_COMMIT") != "" {
|
||||
commitRange = os.Getenv("TRAVIS_COMMIT")
|
||||
if commitRange == "" {
|
||||
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
|
||||
if os.Getenv("TRAVIS_COMMIT_RANGE") != "" {
|
||||
commitRange = os.Getenv("TRAVIS_COMMIT_RANGE")
|
||||
} else if os.Getenv("TRAVIS_COMMIT") != "" {
|
||||
commitRange = os.Getenv("TRAVIS_COMMIT")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue