summaryrefslogtreecommitdiffstats
path: root/.local/bin/allupdate
blob: f439adc9e689b0ec488750738b72ea2048b78a9d (plain) (blame)
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
#!/usr/bin/env bash

$HOME/.local/bin/confgit.sh

## Rust ##
if [ "$(command -v rustup)" ]; then
	rustup update
fi
if [ "$(command -v cargo)" ]; then
	cargo --list | grep install-update &>/dev/null
	if [ $? -eq 0 ]; then
		cargo install-update -a
	fi
fi

if [ "$(command -v gcloud)" ]; then
	gcloud components update -q
fi

case $(uname) in
Darwin)
	# Brew specifics, add installed formula capture later.
	if [ "$(command -v brew)" ]; then
		brew upgrade -q
	fi
	;;
Linux)
	# Store APK list to a file
	apk list -I | cut -d ' ' -f 1 | rev | cut -d '-' -f 3- | rev | sort -u >~/.local/share/apklist

	;;
esac

if [ "$(command -v fetchgit)" ] && [ -d $HOME/.code ]; then
	echo "Updating git repositories $(date -u +"%Y-%m-%d %H:%M:%SZ")"
	if [ -d "$HOME/.golang/go/.git" ]; then
		cd $HOME/.golang/go
		fetchgit
	fi
	if [ "$(command -v gitrect-update)" ] && [ "$(command -v gitrect-fix)" ]; then gitrect-fix && gitrect-update -y; fi
fi

echo "" # Newline
date -u +"%Y-%m-%d %H:%M:%SZ"