fix: check if the property exists before returning an error

This commit is contained in:
Jose Diaz-Gonzalez
2020-05-29 14:42:30 -04:00
parent a0cb7c560e
commit aff0c1fc40

View File

@@ -64,6 +64,10 @@ func PropertyClone(pluginName string, oldAppName string, newAppName string) erro
func PropertyDelete(pluginName string, appName string, property string) error {
propertyPath := getPropertyPath(pluginName, appName, property)
if err := os.Remove(propertyPath); err != nil {
if !PropertyExists(pluginName, appName, property) {
return nil
}
return fmt.Errorf("Unable to remove %s property %s.%s", pluginName, appName, property)
}