Skip to content

Commit

Permalink
Automatically populate Lemmy domains in Android manifest (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Oct 20, 2023
1 parent 2e220d6 commit b7ed7c0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/instances.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@ jobs:
];
EOF
# Put the instances in the Android manifest file
manifestInstances="$(awk '{ print " <data android:host=\""$0"\" />" }' lemmy-instances.txt)"
inSection=false
while IFS= read -r line; do
if [[ $line == *"#AUTO_GEN_INSTANCE_LIST_DO_NOT_TOUCH#"* ]]; then
inSection=true
fi
if [[ $line == *"#INSTANCE_LIST_END#"* ]]; then
echo "$manifestInstances" >> android/app/src/main/AndroidManifest-new.xml
inSection=false
fi
if [[ $line == *"android:host"* ]]; then
if [ "$inSection" = true ]; then
continue
fi
fi
echo "$line" >> android/app/src/main/AndroidManifest-new.xml
done < android/app/src/main/AndroidManifest.xml
mv android/app/src/main/AndroidManifest-new.xml android/app/src/main/AndroidManifest.xml
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
Expand Down

0 comments on commit b7ed7c0

Please sign in to comment.