-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💥 Switch from using nvm to using Volta
Ref: https://volta.sh/
- Loading branch information
Showing
6 changed files
with
76 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "${BASH_SOURCE[0]}")" \ | ||
&& . "../utils.sh" | ||
|
||
declare -r LOCAL_SHELL_CONFIG_FILE="$HOME/.bash.local" | ||
|
||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
||
add_configs() { | ||
|
||
# Check if the configs need to be added. | ||
|
||
. "$LOCAL_SHELL_CONFIG_FILE" | ||
|
||
if command -v volta &> /dev/null; then | ||
return | ||
fi | ||
|
||
declare -r CONFIGS=" | ||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
# Volta | ||
export PATH=\"\$HOME/.volta/bin:\$PATH\" | ||
" | ||
|
||
execute \ | ||
"printf '%s' '$CONFIGS' >> $LOCAL_SHELL_CONFIG_FILE" \ | ||
"Update $LOCAL_SHELL_CONFIG_FILE" | ||
|
||
} | ||
|
||
install() { | ||
execute \ | ||
"curl https://get.volta.sh | bash -s -- --skip-setup" \ | ||
"Install" | ||
} | ||
|
||
install_node() { | ||
|
||
# Install Node.js LTS. | ||
# Note: This will also set it as the default. | ||
|
||
execute \ | ||
". $LOCAL_SHELL_CONFIG_FILE && \ | ||
volta install node" \ | ||
"Install Node.js LTS" | ||
|
||
} | ||
|
||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
||
main() { | ||
|
||
print_in_purple "\n Volta\n\n" | ||
|
||
install | ||
add_configs | ||
install_node | ||
|
||
} | ||
|
||
main |