refactor: rename command to :set-property
This will allow us to set other property values for the buildpacks plugin.
This commit is contained in:
1 parent
5d9157bc40
commit
f81c802ecc
9 files changed
+42
-36
No files matched your search
@@ -139,12 +139,16 @@ func CommandSet(appName string, buildpack string, index int) error {
|
||||
return common.PropertyListSet("buildpacks", appName, "buildpacks", buildpack, index)
|
||||
}
|
||||
|
||||
// CommandStackSet implements buildpacks:stack-set
|
||||
func CommandStackSet(appName string, stack string) error {
|
||||
oldStack := common.PropertyGet("buildpacks", appName, "stack")
|
||||
common.CommandPropertySet("buildpacks", appName, "stack", stack, DefaultProperties, GlobalProperties)
|
||||
if oldStack != stack {
|
||||
return common.PlugnTrigger("post-stack-set", []string{appName, stack}...)
|
||||
// CommandSetProperty implements buildpacks:set-property
|
||||
func CommandSetProperty(appName string, property string, value string) error {
|
||||
oldStack := ""
|
||||
if property == "stack" {
|
||||
oldStack = common.PropertyGet("buildpacks", appName, "stack")
|
||||
}
|
||||
|
||||
common.CommandPropertySet("buildpacks", appName, property, value, DefaultProperties, GlobalProperties)
|
||||
if property == "stack" && oldStack != value {
|
||||
return common.PlugnTrigger("post-stack-set", []string{appName, value}...)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user