Corrected link reading for category deletion

parent f724bef8
......@@ -71,9 +71,9 @@ void mainFn(string[] args) {
void deleteCategories(string[] categories, bool force = false) {
auto allAliases = getAliases(Yes.fullPath);
void deleteAliasesOfCategory(string category) {
auto categoryPath = getCatDirPath(category);
auto categoryPath = getCatDirPath(category).stripRight('/');
foreach(cat; allAliases) {
if (categoryPath == readLink(cat)) {
if (categoryPath == readLink(cat).stripRight('/')) {
rm(cat);
}
}
......@@ -95,9 +95,10 @@ void deleteCategories(string[] categories, bool force = false) {
if (!force) {
rm(categoryPath);
continue;
} else {
category = getCategoryByAlias(category);
categoryPath = getCatDirPath(category).stripRight('/');
}
category = getCategoryByAlias(category);
categoryPath = getCatDirPath(category);
}
deleteAliasesOfCategory(category);
auto subcategories = getSubcategories(category);
......
0.12~pre1
\ No newline at end of file
0.12~pre2
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment