fix: properties like type were not correctly replaced when updating a node

This commit is contained in:
2026-03-29 19:27:18 +02:00
parent 55fd63be15
commit 68f4b67283

View File

@@ -65,9 +65,17 @@ var updateCmd = &cobra.Command{
} else if slices.Contains(uAddTags, "_status::open") { } else if slices.Contains(uAddTags, "_status::open") {
uRmTags = append(uRmTags, "_status::done") uRmTags = append(uRmTags, "_status::done")
} }
if slices.ContainsFunc(uAddTags, func(e string) bool { return strings.HasPrefix(e, "_prio") }) {
uRmTags = append(uRmTags, "_prio::low", "_prio::medium", "_prio::high") for _, prefix := range []string{"_type::", "_status::", "_prio::", "_namespace::"} {
if slices.ContainsFunc(uAddTags, func(e string) bool { return strings.HasPrefix(e, prefix) }) {
for _, existing := range node.Tags {
if strings.HasPrefix(existing, prefix) {
uRmTags = append(uRmTags, existing)
} }
}
}
}
if cmd.Flags().Changed("title") { if cmd.Flags().Changed("title") {
node.Title = uTitle node.Title = uTitle