Fixed an issue in the bootstrap script when project name left as placeholder.
This commit is contained in:
+11
-2
@@ -140,10 +140,19 @@ rewrite "$W/README.md" \
|
|||||||
# Xcode project: PBXProject name + directory.
|
# Xcode project: PBXProject name + directory.
|
||||||
if [ -d "$XCODEPROJ" ]; then
|
if [ -d "$XCODEPROJ" ]; then
|
||||||
rewrite "$XCODEPROJ/project.pbxproj" -e "s/\"Site\"/\"${NAME}\"/g"
|
rewrite "$XCODEPROJ/project.pbxproj" -e "s/\"Site\"/\"${NAME}\"/g"
|
||||||
|
|
||||||
|
# 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
|
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"
|
git mv "$XCODEPROJ" "$XCODEPROJ_RENAMED" 2>/dev/null || mv "$XCODEPROJ" "$XCODEPROJ_RENAMED"
|
||||||
else
|
else
|
||||||
mv "$XCODEPROJ" "./${NAME}.xcodeproj"
|
mv "$XCODEPROJ" "$XCODEPROJ_RENAMED"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user