Skip to content

Commit ae68b75

Browse files
author
Bohdan Potměkleč
committed
Fix renaming non-top-level category
1 parent a63d064 commit ae68b75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stup

+2-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ execute_rename_category()
673673
fi
674674
resolve_required_category
675675

676-
if [ -e "$REPOSITORY_ROOT/$CATEGORY_NAME" ]; then
676+
mkdir -p "$(dirname "$REPOSITORY_ROOT/$CATEGORY_NAME")"
677+
if [ -e "$REPOSITORY_ROOT/$CATEGORY_NAME" ] && ! [ -z "$(ls -A "$REPOSITORY_ROOT/$CATEGORY_NAME")" ]; then
677678
print_error "Category can't be renamed, new location in filesystem is already in use"
678679
exit 1
679680
fi

0 commit comments

Comments
 (0)