ec4f5b8059
- /home/dot_config/rclone/system/s3-docker.service.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_13-post-install-packages.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-warp.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-timeshift.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-install-aqua-packages.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_15-install-asdf-packages.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_18-install-sdkman.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_19-gnome-extension-settings.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_19-theme-files.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_20-font.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_21-dconf-settings.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_45-vmware.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_57-netdata.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_59-connect-tailscale.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_70-misc-bug-fixes.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_06-bin-symlink.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_40-chrome.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_28-privoxy.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_27-tor.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_05-log-config.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_04-environment-profile.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-warp.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-timeshift.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-keybase.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14-install-aqua-packages.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_15-install-asdf-packages.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_18-install-sdkman.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_19-gnome-extension-settings.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_19-theme-files.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_20-font.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_21-dconf-settings.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_45-vmware.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_50-crontab.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_59-connect-tailscale.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_70-misc-bug-fixes.sh.tmpl
36 lines
1.6 KiB
Bash
36 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
{{- if (ne .host.distro.family "windows") }}
|
|
# @file ASDF Plugins / Install
|
|
# @brief Configures ASDF plugins and ensures they are pre-installed.
|
|
# @description
|
|
# This script ensures ASDF is setup and then adds the plugins specified in the `~/.tool-versions` file. After that,
|
|
# it ensures the ASDF plugins are pre-installed.
|
|
|
|
# dot_tool-versions.tmpl hash: {{ include "dot_tool-versions.tmpl" | sha256sum }}
|
|
|
|
{{- includeTemplate "universal/profile" }}
|
|
{{- includeTemplate "universal/logg" }}
|
|
|
|
if [ -f "$ASDF_DIR/asdf.sh" ] && [ -f ~/.tool-versions ]; then
|
|
logg info 'Sourcing asdf.sh'
|
|
. ${ASDF_DIR}/asdf.sh
|
|
cat .tool-versions | while read TOOL; do
|
|
logg info 'Installing ASDF plugin `'"$(echo "$TOOL" | sed 's/ .*//')"'`'
|
|
asdf plugin add "$(echo "$TOOL" | sed 's/ .*//')"
|
|
done
|
|
# Only proceed with installation if either DEBUG_MODE is enabled or ~/.cache/megabyte-labs/asdf-install is missing
|
|
# Added to save time between tests because PHP takes awhile to install
|
|
if [ "$DEBUG_MODE" == 'true' ] || [ ! -f "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte-labs/asdf-install" ]; then
|
|
logg info 'Installing ASDF dependencies derived from `~/.tool-versions` via `asdf install`'
|
|
asdf install || EXIT_CODE=$?
|
|
if [ -n "$EXIT_CODE" ]; then
|
|
logg error 'Error installing the ASDF plugins specified in `~/.tool-versions`'
|
|
fi
|
|
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte-labs"
|
|
touch "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte-labs/asdf-install"
|
|
fi
|
|
else
|
|
logg warn 'The `$ASDF_DIR/asdf.sh` or `~/.tool-versions` file is not present'
|
|
fi
|
|
|
|
{{ end -}}
|