Skip to content

Commit 24a15ff

Browse files
authored
Merge pull request #327 from droot/vendor-update-bugfix-313
fixed gopkg.toml lookup code in vendor update
2 parents 2489b81 + 46d1127 commit 24a15ff

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cmd/kubebuilder/initproject/vendor.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,20 @@ func depExists() bool {
8989
return err == nil
9090
}
9191

92+
// depManifestExists checks if DepManifestFile exists or not. It will panic
93+
// if it encounters unknown errors.
9294
func depManifestExists() bool {
9395
_, err := os.Stat(depManifestFile)
94-
return os.IsExist(err)
96+
if err == nil {
97+
// file exists
98+
return true
99+
}
100+
if os.IsNotExist(err) {
101+
return false
102+
}
103+
// some other error, panic
104+
log.Fatalf("error looking up dep manifest file : %v", err)
105+
return false
95106
}
96107

97108
func createNewDepManifest() {

0 commit comments

Comments
 (0)