-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathupup
executable file
·89 lines (73 loc) · 1.69 KB
/
upup
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
#
# Get macOS software updates, update Homebrew, npm, dotfiles, VS Code and some other software.
#
# - Run updates:
#
# `upup`
#
# ---
# Author: Nick Plekhanov, https://nikkhan.com/
# License: MIT
# https://github.com/nicksp/dotfiles
set -e
set -u
set -o pipefail
header() {
echo "$(tput sgr 0 1)$(tput setaf 6)$1$(tput sgr0)"
}
warning() {
tput setaf 1
echo "/!\\ $1 /!\\"
tput sgr0
}
# Ask for the administrator password upfront
warning "Activate sudo"
sudo echo "Sudo activated!"
echo
# Dotfiles
dotfiles
echo
# macOS
header "Updating macOS system..."
sudo softwareupdate -ia --verbose
echo
# App Store
# https://github.com/mas-cli/mas?tab=readme-ov-file#%EF%B8%8F-known-issues
# header "Updating apps from App Store..."
# sudo mas upgrade
# echo
# Homebrew formulae
header "Updating Homebrew packages..."
brew update
outdated_packages=$(brew outdated)
if [ -z "$outdated_packages" ]; then
echo "✨ All packages already up-to-date."
else
echo "📦 Outdated packages:"
echo "$outdated_packages"
brew upgrade
fi
brew cleanup --prune=all
brew missing
brew doctor
echo
# Homebrew casks
header "Updating Homebrew casks..."
brew upgrade --cask $(brew list --cask)
# Raycast
header "Updating Raycast and its extensions..."
open raycast://extensions/raycast/raycast/check-for-updates
open raycast://extensions/raycast/raycast/check-for-extension-updates
# npm
header "Updating global npm modules..."
npm update -g
echo
# VS Code extensions
header "Updating VS Code extensions..."
for extension in $(code --list-extensions); do
# Reinstall each extension (which automatically updates it if there is a newer version)
code --install-extension $extension --force
done
# Nyan cat!
nyan