blob: 89e8b74a88667e40b218e9cf9d8247d7bb1b2e2d (
plain)
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
|
#!/bin/bash
C="\x1b[0m"
GRN="\x1b[32m"
YEL="\x1b[33m"
BLU="\x1b[34m"
col2="$BLU::$C"
if [ "$1" != "--skip-dl" ]; then
current=$(grep '^pkgver' PKGBUILD | sed 's/"//g' | sed 's/pkgver=//g')
echo -e "$col2 Getting latest version..." >/dev/stderr
url=https://github.com/Yasu3D/MercuryMapper
vlatest="$(basename "$(curl -Ls -o /dev/null -w "%{url_effective}" "$url/releases/latest")")"
latest="${vlatest:1}"
if [ "$current" = "" ]; then
current="(nothing)"
fi
if [ "$current" = "$latest" ] && [ "$1" != "-f" ]; then
echo -e "$col2 Current $GRN$current$C is latest, no update required" >/dev/stderr
exit
else
echo -e "$col2 Changing current version from $YEL$current$C to $GRN$latest$C"
sed -i -e 's/^pkgver=".*"/pkgver="'"$latest"'"/g' PKGBUILD
fi
fi
echo -e "$col2 Updating checksums..."
updpkgsums
echo -e "$col2 Writing .SRCINFO file..."
makepkg --printsrcinfo > .SRCINFO
echo -e "$col2 Making and installing new package..."
makepkg -si
if [ "$(git config user.email)" == "spey.aur@speykious.dev" ]; then
echo -e "$col2 Bump version in git history..."
if [ "$1" != "--skip-dl" ]; then
git commit -am "Bump to version $latest"
else
# we write the commit message ourselves
git commit -a
fi
echo -e "$col2 Pushing new commit..."
git push
fi
echo -e "$col2 Done"
|