Create dep manifest file if it doesn't exist
@@ -55,7 +55,7 @@ func RunVendorInstall(cmd *cobra.Command, args []string) {
if !depExists() {
log.Fatalf("Dep is not installed. Follow steps at: https://golang.github.io/dep/docs/installation.html")
}
- if Update {
+ if Update && depManifestExists() {
if err := updateDepManifest(); err != nil {
log.Fatalf("error upgrading the dep manifest (Gopkg.toml): %v", err)
}
@@ -85,6 +85,11 @@ func depExists() bool {
return err == nil
}
+func depManifestExists() bool {
+ _, err := os.Stat(depManifestFile)
+ return os.IsExist(err)
+}
+
func createNewDepManifest() {
depTmplArgs := map[string]string{
"Version": version.GetVersion().KubeBuilderVersion,
