2024-05-04 21:05:33 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# @file Volta initialization
|
|
|
|
# @brief This script initializes Volta and ensures the latest version of node and yarn are installed
|
|
|
|
|
|
|
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
|
|
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
|
|
|
|
|
|
|
if command -v volta > /dev/null; then
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Running volta setup'
|
2024-05-04 21:05:33 -07:00
|
|
|
volta setup
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Installing latest version of Node.js via Volta'
|
2024-05-04 21:05:33 -07:00
|
|
|
volta install node@latest
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Installing latest version of Yarn via Volta'
|
2024-05-04 21:05:33 -07:00
|
|
|
volta install yarn@latest
|
|
|
|
else
|
|
|
|
logg info 'Volta is not installed'
|
|
|
|
fi
|