Skip to content

Commit 167907c

Browse files
97%
1 parent eebc9bf commit 167907c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/renamer/doModify.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ async function updateClusterTagFrontmatter(plugin: Plugin, fileItem: RenamedItem
2828
return;
2929
}
3030
// Update the "cluster tag" property
31+
let tagName = fileItem.newPath.split("/")[1]
32+
tagName = tagName.endsWith("-cluster") ? tagName : `${tagName}-cluster`
3133
const clusterTagIndex = (frontmatter.tags as string[]).findIndex(tag => tag.contains("-cluster"));
32-
(frontmatter.tags as string[])[clusterTagIndex] = fileItem.newPath.split("/")[1]
34+
(frontmatter.tags as string[])[clusterTagIndex] = tagName
3335
});
3436

3537
} catch (error) {
36-
console.error("Error updating cluster tag frontmatter:", error);
38+
console.error("Error updating -cluster tag frontmatter:", error);
3739
}
3840
}
3941
}

0 commit comments

Comments
 (0)