Implemented service delete command

This commit is contained in:
Philipp Wolfer 2023-12-08 17:27:04 +01:00
parent 7f2db58462
commit 543a9c666d
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
5 changed files with 123 additions and 4 deletions

View file

@ -68,7 +68,13 @@ func (c *ServiceConfig) Save() error {
for k, v := range c.ConfigValues {
viper.Set(key+"."+k, v)
}
return viper.WriteConfig()
return WriteConfig()
}
// Deletes the service configuration from the config file
func (c *ServiceConfig) Delete() error {
key := "service." + c.Name
return WriteConfig(key)
}
type ServiceList []ServiceConfig