feat: rename remote name
This commit is contained in:
@ -360,7 +360,19 @@ func (fc *FluckyConfig) RenameSensor(oldName, newName string) error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Could not find sensor %v and replace the name", oldName)
|
||||
return fmt.Errorf("Could not find sensor %v to replace into ", oldName)
|
||||
}
|
||||
|
||||
// RenameRemote renames a remote address identified by the name or the UUID
|
||||
func (fc *FluckyConfig) RenameRemote(oldName, newName string) error {
|
||||
for _, remote := range fc.Remotes {
|
||||
if remote.Name == oldName ||
|
||||
remote.RemoteID == oldName {
|
||||
remote.Name = newName
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Could not find remote name %v to replace into %v", oldName, newName)
|
||||
}
|
||||
|
||||
// ToJSON returns the struct as JSON string
|
||||
|
Reference in New Issue
Block a user