forked from CodelyTV/dotly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_all
executable file
·40 lines (30 loc) · 1.49 KB
/
update_all
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
#!/usr/bin/env bash
set -euo pipefail
source "$DOTLY_PATH/scripts/core/_main.sh"
##? Update all packages
##?
##? Usage:
##? update_all
docs::parse "$@"
output::write "🎩 Let's update all your packages"
if platform::is_macos; then
output::header '🍎 Updating App Store apps'
mas upgrade
output::header '🍺 Updating Brew and Brew apps (this could take a while)'
brew update >/dev/null 2>&1
brew outdated | xargs -n1 brew upgrade
output::header '🍻 Updating Brew Cask apps (this could take a while)'
OUTDATED_CASKS=$(brew outdated --cask)
if [ -n "$OUTDATED_CASKS" ]; then
echo "$OUTDATED_CASKS" | grep -v real-vnc | xargs -n1 brew cask install --force
fi
fi
platform::command_exists tldr && output::header '📜 Updating tldr database' && tldr --update
platform::command_exists composer && output::header '🐘 Updating Composer' && composer self-update && composer global update
platform::command_exists pip3 && output::header '🐍 Updating pip' && pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
platform::command_exists gem && output::header '♦️ Updating gem' && gem update
platform::command_exists npm && output::header '🌈 Updating npm' && npm install -g npm && npm update -g
platform::command_exists cargo && output::header '📦 Updating cargo' && cargo update
platform::command_exists deno && output::header '🦕 Updating deno' && deno upgrade
output::empty_line
output::solution '👌 All your packages have been successfully updated'