use App Name to set android label

This commit is contained in:
gutmet 2020-05-20 00:59:58 +02:00
parent f4e85c0990
commit 5b89a03bcd

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
if [ "$#" -ne 2 ]; then if [ "$#" -ne 2 ]; then
echo "USAGE: $0 PACKAGE_NAME DESCRIPTION" echo "USAGE: $0 APP_NAME DESCRIPTION"
exit 1 exit 1
fi fi
@ -9,9 +9,11 @@ PROJECT_HOME=~/AndroidStudioProjects
ORG_PATH="$PROJECT_HOME/defaultOrg" ORG_PATH="$PROJECT_HOME/defaultOrg"
KEY_PROPERTIES_PATH="$PROJECT_HOME/defaultKeyProperties" KEY_PROPERTIES_PATH="$PROJECT_HOME/defaultKeyProperties"
packageName="$1" appName="$1"
packageName=`echo "$appName" | tr '[:upper:]' '[:lower:]'`
description="$2" description="$2"
echo "App Name: $appName"
echo "Package Name: $packageName" echo "Package Name: $packageName"
echo "Description: $description" echo "Description: $description"
@ -255,11 +257,17 @@ dependencies {
EOF EOF
#######################
## set android label ##
#######################
sed -i "s/android:label=\"$packageName\"/android:label=\"$appName\"/" android/app/src/main/AndroidManifest.xml
##################### #####################
## empty README.md ## ## empty README.md ##
##################### #####################
cat > README.md <<EOF cat > README.md <<EOF
# $packageName # $appName
$description $description