This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
comptaplan_app/tools/set-title.sh
2021-11-28 15:50:12 +01:00

20 lines
558 B
Bash
Executable File

#!/bin/bash
TITLE="$1"
echo "Setting the application title to $TITLE"
sed -i "s/android:label=\"[^\"]\+\"/android:label=\"$TITLE\"/" android/app/src/main/AndroidManifest.xml
NAME_LENGTH="${#TITLE}"
LONG_NAME="$(( $NAME_LENGTH > 15))" # 1 if long name
BUNDLE_NAME="$(echo $TITLE | cut -c -15)"
perl -0777 -i -pe "s#\t<key>CFBundleName</key>\n[^\n]+#\t<key>CFBundleName</key>\n\t<string>$BUNDLE_NAME</string>#igs" ios/Runner/Info.plist
if [ "$LONG_NAME" = "1" ] ; then
# todo : set bundleDisplayName
echo "Warning: name truncated to $BUNDLE_NAME"
fi