summary refs log tree commit diff
path: root/.config/mpv/update-uosc.sh
blob: 7334b58f8b173b028872f490352b09b60b094d33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -e

URI="
	https://github.com/tomasklaen/uosc/releases/latest/download/uosc.zip
	https://github.com/tomasklaen/uosc/releases/latest/download/uosc.conf
"

target="$(readlink -f -- "$(dirname "$0")")"
tmp=$(mktemp -d)
trap '{ rm -r $tmp; }' EXIT INT
cd "$tmp" || exit 1

for src in $URI; do
	curl -sLO "$src"
	{ unzip -qd "$tmp"/ "$tmp"/*.zip 2>/dev/null && rm "$tmp"/*.zip; } || true
	{ tar -xf "$tmp"/*.tar* -C "$tmp"/ 2>/dev/null && rm "$tmp"/*.tar*; } || true
done

rsync -ac "$tmp"/ "$target"/