mattermost-mobile/scripts/postinstall.sh
Rahim Rahman 985fa692a6
fix(MM-62375): OOM on gif (#8573)
* fix(MM-62375): OOM on gif
* add APNG4Android into github action script to download
* change to mattermost/APNG4Android
2025-02-12 08:18:54 -07:00

52 lines
No EOL
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
function installPods() {
echo "Getting Cocoapods dependencies"
npm run pod-install
}
function installPodsM1() {
echo "Getting Cocoapods dependencies"
npm run pod-install-m1
}
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ $(uname -p) == 'arm' ]]; then
installPodsM1
else
installPods
fi
fi
COMPASS_ICONS="node_modules/@mattermost/compass-icons/font/compass-icons.ttf"
if [ -z "$COMPASS_ICONS" ]; then
echo "Compass Icons font not found"
exit 1
else
echo "Configuring Compass Icons font"
cp "$COMPASS_ICONS" "assets/fonts/"
cp "$COMPASS_ICONS" "android/app/src/main/assets/fonts"
fi
ASSETS=$(node scripts/generate-assets.js)
if [ -z "$ASSETS" ]; then
echo "Error Generating app assets"
exit 1
else
echo "Generating app assets"
fi
SOUNDS="assets/sounds"
if [ -z "$SOUNDS" ]; then
echo "Sound assets not found"
exit 1
else
echo "Copying sound assets for bundling"
mkdir -p "android/app/src/main/res/raw/"
cp $SOUNDS/* "android/app/src/main/res/raw/"
fi
APNG4Android="node_modules/APNG4Android"
if [ ! -z "$APNG4Android" ]; then
git clone -b "fix/MM-62375-OOM-on-gif-with-build-updates" --single-branch --depth 1 https://github.com/mattermost/APNG4Android.git "$APNG4Android";
fi