Fixed an issue in the bootstrap script when project name left as placeholder.

This commit is contained in:
2026-08-02 02:59:53 +02:00
parent 422560ec10
commit d10ced84a8
+13 -4
View File
@@ -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