From d10ced84a86e3e6a84c90b04d8c763d3fefdee5b Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 2 Aug 2026 02:59:53 +0200 Subject: [PATCH] Fixed an issue in the bootstrap script when project name left as placeholder. --- Scripts/bootstrap | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Scripts/bootstrap b/Scripts/bootstrap index 8d44d58..34a1120 100755 --- a/Scripts/bootstrap +++ b/Scripts/bootstrap @@ -140,10 +140,19 @@ rewrite "$W/README.md" \ # Xcode project: PBXProject name + directory. if [ -d "$XCODEPROJ" ]; then rewrite "$XCODEPROJ/project.pbxproj" -e "s/\"Site\"/\"${NAME}\"/g" - if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then - git mv "$XCODEPROJ" "./${NAME}.xcodeproj" 2>/dev/null || mv "$XCODEPROJ" "./${NAME}.xcodeproj" - else - mv "$XCODEPROJ" "./${NAME}.xcodeproj" + + # Skip the rename when the display name was left as the placeholder: the + # source and destination are then the same path, and `mv dir dir` fails + # (it moves the directory into itself), which would abort the run here — + # after the rewrites, but before the self-cleanup. + XCODEPROJ_RENAMED="./${NAME}.xcodeproj" + + if [ "$XCODEPROJ" != "$XCODEPROJ_RENAMED" ]; then + if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git mv "$XCODEPROJ" "$XCODEPROJ_RENAMED" 2>/dev/null || mv "$XCODEPROJ" "$XCODEPROJ_RENAMED" + else + mv "$XCODEPROJ" "$XCODEPROJ_RENAMED" + fi fi fi