Skip to content

Commit

Permalink
Fix windows test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Meyer <ameyer@pivotal.io>
Signed-off-by: Natalie Arellano <narellano@pivotal.io>
  • Loading branch information
ameyer-pivotal authored and Javier Romero and Andrew Meyer committed Feb 12, 2020
1 parent 2343ad4 commit 41d5889
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ func testBuild(t *testing.T, when spec.G, it spec.S) {
Builder: builderName,
ClearCache: true,
Buildpacks: []string{
"buildid@buildpack.1.version",
"buildpack.1.id@buildpack.1.version",
filepath.Join("testdata", "buildpack"),
},
})
Expand Down
7 changes: 2 additions & 5 deletions internal/buildpack/locatortype.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package buildpack

import (
"fmt"
"os"
"strings"

"github.com/google/go-containerregistry/pkg/name"
Expand Down Expand Up @@ -52,11 +53,7 @@ func GetLocatorType(locator string, buildpacksFromBuilder []dist.BuildpackInfo)
return URILocator, nil
}

exists, err := paths.Exists(locator)
if err != nil {
return InvalidLocator, err
}
if exists {
if _, err := os.Stat(locator); err == nil {
return URILocator, nil
}

Expand Down
10 changes: 0 additions & 10 deletions internal/paths/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ func IsDir(path string) (bool, error) {
return fileInfo.IsDir(), nil
}

func Exists(path string) (bool, error) {
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
return false, nil // does not exist
}
return false, err // some other error
}
return true, nil
}

func FilePathToURI(path string) (string, error) {
var err error
if !filepath.IsAbs(path) {
Expand Down

0 comments on commit 41d5889

Please sign in to comment.