install.fairie/home/.chezmoiscripts/universal/run_onchange_before_09-node-version.sh.tmpl
Brian Zalewski 0ce5a3c77b Update 21 files
- /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_98-cleanup.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_99-restart-gnome.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_98-cleanup.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_99-restart-gnome.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-install-go.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl
2023-04-12 03:57:02 +00:00

26 lines
975 B
Cheetah

{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env bash
# @file Node.js Version
# @brief Ensures a recent version of Node.js is available to the user by leveraging Volta
# @description
# This script installs the latest version of Node.js with Volta if the default Node.js version
# is an outdated version.
# Node.js version: {{ output "node" "--version" }}
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Ensure recent version of Node.js is being used
if command -v volta > /dev/null; then
if ! test "$(node --version | sed 's/^v//' | awk '{print $1}' | awk -F'.' ' ( $1 > 15) ')"; then
logg info 'Installing latest version of Node.js'
volta install node@latest
else
logg info 'Node.js appears to meet the minimum version requirements (version >15)'
fi
else
logg warn 'Volta is not installed - skipping logic that ensures Node.js meets the version requirement of >15'
fi
{{ end -}}