extract project root env var export to env.sh and add asset gen script

This commit is contained in:
julian 2024-05-22 10:32:29 -06:00
parent ab2806a4b7
commit e206fefceb
4 changed files with 26 additions and 10 deletions

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -x -e
source ./env.sh
# run icon and image generators
pushd "${APP_PROJECT_ROOT_DIR}"
flutter pub get
dart run flutter_native_splash:create
dart run flutter_launcher_icons
popd

View file

@ -2,6 +2,8 @@
set -x -e
source ./env.sh
if [ $# -ne 1 ]; then
echo "Usage: $0 <theme specific assets dir name (ex. stack_wallet)>"
exit 1
@ -22,8 +24,5 @@ ln -s "${ASSET_SOURCES_DIR}/bundled_themes/${SELECT_ASSETS_DIR}" "${ASSETS_DIR}/
rm -f "${ASSETS_DIR}/icon"
ln -s "${ASSET_SOURCES_DIR}/icon/${SELECT_ASSETS_DIR}" "${ASSETS_DIR}/icon"
# todo run flutter_native_splash
# todo run flutter_launcher_icons
# run icon and image generators
"${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/asset_generators.sh"

View file

@ -2,11 +2,7 @@
set -x -e
# set project root
THIS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
pushd "${THIS_SCRIPT_DIR}/../"
export APP_PROJECT_ROOT_DIR="$(pwd)"
popd
source ./env.sh
APP_PLATFORMS=("android" "ios" "macos" "linux" "windows")
APP_NAMED_IDS=("stack_wallet" "stack_duo")

9
scripts/env.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -x -e
# set project root
THIS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
pushd "${THIS_SCRIPT_DIR}/../"
export APP_PROJECT_ROOT_DIR="$(pwd)"
popd