using the odoutil for error and log for succes logging
@@ -84,8 +84,8 @@ var updateCmd = &cobra.Command{
if len(componentGit) != 0 {
err := component.Update(client, componentName, applicationName, "git", componentGit, componentGitRef, stdout)
- util.CheckError(err, "")
- fmt.Printf("The component %s was updated successfully\n", componentName)
+ odoutil.CheckError(err, "")
+ log.Successf("The component %s was updated successfully", componentName)
} else if len(componentLocal) != 0 {
// we want to use and save absolute path for component
dir, err := pkgUtil.GetAbsPath(componentLocal)
@@ -97,14 +97,14 @@ var updateCmd = &cobra.Command{
os.Exit(1)
}
err = component.Update(client, componentName, applicationName, "local", dir, "", stdout)
- util.CheckError(err, "")
- fmt.Printf("The component %s was updated successfully, please use 'odo push' to push your local changes\n", componentName)
+ odoutil.CheckError(err, "")
+ log.Successf("The component %s was updated successfully, please use 'odo push' to push your local changes", componentName)
} else if len(componentBinary) != 0 {
path, err := pkgUtil.GetAbsPath(componentBinary)
util.CheckError(err, "")
err = component.Update(client, componentName, applicationName, "binary", path, "", stdout)
- util.CheckError(err, "")
- fmt.Printf("The component %s was updated successfully, please use 'odo push' to push your local changes\n", componentName)
+ odoutil.CheckError(err, "")
+ log.Successf("The component %s was updated successfully, please use 'odo push' to push your local changes", componentName)
}
},
}
