diff --git a/dist/.shellrc b/dist/.shellrc new file mode 100644 index 0000000..f847ed1 --- /dev/null +++ b/dist/.shellrc @@ -0,0 +1,3 @@ +export ANDROID_HOME='/opt/android-sdk' +export PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin" +export PATH="${PATH}:${ANDROID_HOME}/platform-tools" diff --git a/dist/pacman.sh b/dist/pacman.sh index 2f6176e..cf4c3c7 100755 --- a/dist/pacman.sh +++ b/dist/pacman.sh @@ -73,6 +73,10 @@ else yes | su - "$BUILD_USER" -c "paru -S --noconfirm ${paru_packages[*]}" yes | su - "$BUILD_USER" -c "yes | sdkmanager --licenses" yes | su - "$BUILD_USER" -c "yes | sudo pacman -Syu --noconfirm gradle" + # check if bashrc or zshrc contains sdkman initialization, if not add it + SHELL_RC_CONTENT="$(echo dist/.shellrc)" + echo "Checking shell rc for sdkman initialization..." + yes | su - "$BUILD_USER" -c "if [[ -f ~/.bashrc ]]; then echo ${SHELL_RC_CONTENT} >> ~/.bashrc; fi else if [[ -f ~/.zshrc ]]; then echo ${SHELL_RC_CONTENT} >> ~/.zshrc; fi" fi