-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·64 lines (51 loc) · 1.24 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
# This script aims to update packages of several services used
# - homebrew
# - homebrew casks
# - NVM
# - NPM
# - Apple Store (via brew/mas)
# HOMEBREW
# Update the formulaes and Homebrew itself:
brew update
# HOMEBREW CASKS
brew upgrade --cask --greedy
# Upgrade all formulaes:
brew upgrade --greedy-auto-updates
# Uninstall unused old versions of formulaes:
brew cleanup --prune=all
# We need NVM loading:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Install Node 16 version.
# nvm install 16 --skip-default-packages --latest-npm
# Install Node 18 version.
# nvm install 18 --skip-default-packages --latest-npm
# Install Node 20 version.
nvm install 20 --skip-default-packages --latest-npm
# Install Node 20 version.
nvm install 22 --skip-default-packages --latest-npm
# Set default latest Node version.
nvm alias default 20
nvm use 20
packages=(
eslint
npm
prettier
typescript
corepack
yarn
pnpm
)
# Installing some default global npm packages
for package in ${packages[@]}; do
npm install --global $package
done
# NPM
# Upgrade all global NPM packages
npm install npm -g
npm update -g
npm cache clean --force
npm cache verify
# Apple Store (via brew/mas)
mas upgrade