From 2de719658e771af91d41a188b545015ff0ca6628 Mon Sep 17 00:00:00 2001 From: enggnr <129082112+enggnr@users.noreply.github.com> Date: Sun, 9 Jul 2023 10:14:49 +0530 Subject: [PATCH] Install Android SDK Tools, draft (#60) --- .../run_onchange_after_19-android-sdk.sh.tmpl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 home/.chezmoiscripts/universal/run_onchange_after_19-android-sdk.sh.tmpl diff --git a/home/.chezmoiscripts/universal/run_onchange_after_19-android-sdk.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_19-android-sdk.sh.tmpl new file mode 100644 index 00000000..bccd9b91 --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_19-android-sdk.sh.tmpl @@ -0,0 +1,18 @@ +{{- if ne .host.distro.family "windows" -}} +#!/usr/bin/env bash +# @file Android SDK Pre-Install +# @brief Pre-installs a list of Android SDKs and Tools +# @description +# This script pre-installs Android SDKs and Tools defined in [`.chezmoidata.yaml`](https://github.com/megabyte-labs/install.doctor/tree/master/home/.chezmoidata.yaml) +# so that the user does not have to do anything on launching Android Studio for the first time. + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +### Run `sdkmanager`, if it is installed, to install SDKs and Tools +if command -v vim > /dev/null; then + {{ range .androidSDKs }} + echo 'y' | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --install "{{ . }}" 2>&1 /dev/null + {{ end }} +fi +{{ end -}}