forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
#!/bin/sh | ||
set -euf | ||
|
||
# should it be uncommented? | ||
#pkg upgrade # Termux | ||
|
||
# should I use apt-get? | ||
# "unstable API" doesn't seem to matter here | ||
if apt update && apt upgrade | ||
then | ||
apt autoclean || true | ||
apt autopurge || true | ||
|
||
# https://github.com/pypa/pip/issues/4551 | ||
|
||
# if `apt` fails, | ||
# it's likely `npm` will also fail | ||
npm update -g || true # for LSPs | ||
if [ -z "${TERMUX_VERSION:-}" ]; then | ||
# should I use apt-get? | ||
# "unstable API" doesn't seem to matter here | ||
if apt update && apt upgrade | ||
then | ||
apt autoclean || true | ||
apt autopurge || true | ||
|
||
# https://github.com/pypa/pip/issues/4551 | ||
|
||
# if `apt` fails, | ||
# it's likely `npm` will also fail | ||
npm update -g || true # for LSPs | ||
fi | ||
|
||
rustup upgrade | ||
crates="$(\ | ||
cargo install --list |\ | ||
# assume stable Cargo API | ||
grep -E '^[a-z0-9_-]+ v[0-9.]+:$' |\ | ||
cut -f1 -d' ' \ | ||
)" | ||
[ -n "$crates" ] && cargo install $crates | ||
else | ||
# https://wiki.termux.com/wiki/Package_Management | ||
if pkg upgrade; then | ||
# I have backups, no worries | ||
pkg autoclean || true | ||
apt autopurge || true | ||
|
||
npm update -g || true # for LSPs | ||
fi | ||
fi | ||
|
||
rustup upgrade | ||
crates="$(\ | ||
cargo install --list |\ | ||
# assume stable Cargo API | ||
grep -E '^[a-z0-9_-]+ v[0-9.]+:$' |\ | ||
cut -f1 -d' ' \ | ||
)" | ||
[ -n "$crates" ] && cargo install $crates |