mirror of https://github.com/dsoprea/go-exif.git
Do not include v1/legacy in coverage
parent
25524615d1
commit
ebd20ffc59
|
@ -12,4 +12,9 @@ install:
|
|||
- go get -t ./...
|
||||
- go get github.com/mattn/goveralls
|
||||
script:
|
||||
- goveralls -v -service=travis-ci
|
||||
# Don't test recursively, so we stay within v1/legacy.
|
||||
- go test -v github.com/dsoprea/go-exif
|
||||
- go test -v github.com/dsoprea/go-exif/exif-read-tool
|
||||
# Coverage is based on v2.
|
||||
- cd v2
|
||||
- EXIF_MODULE_ROOT_PATH="$(pwd)" goveralls -v -service=travis-ci
|
||||
|
|
|
@ -24,6 +24,11 @@ var (
|
|||
)
|
||||
|
||||
func GetModuleRootPath() string {
|
||||
moduleRootPath := os.Getenv("EXIF_MODULE_ROOT_PATH")
|
||||
if moduleRootPath != "" {
|
||||
return moduleRootPath
|
||||
}
|
||||
|
||||
currentWd, err := os.Getwd()
|
||||
log.PanicIf(err)
|
||||
|
||||
|
@ -33,14 +38,11 @@ func GetModuleRootPath() string {
|
|||
for {
|
||||
tryStampFilepath := path.Join(currentPath, ".MODULE_ROOT")
|
||||
|
||||
f, err := os.Open(tryStampFilepath)
|
||||
if err == nil {
|
||||
f.Close()
|
||||
break
|
||||
}
|
||||
|
||||
if err.Error() != "No such file or directory" {
|
||||
_, err := os.Stat(tryStampFilepath)
|
||||
if err != nil && os.IsNotExist(err) != true {
|
||||
log.Panic(err)
|
||||
} else if err == nil {
|
||||
break
|
||||
}
|
||||
|
||||
visited = append(visited, tryStampFilepath)
|
||||
|
|
Loading…
Reference in New Issue