summarylogtreecommitdiffstats
path: root/update.sh
blob: 8a190bf802eba5e3d25313571e082148d90bdc97 (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
#!/usr/bin/env bash
set -euo pipefail

set -x

scripts=(sc tc j)
widths=(compressed condensed extended normal wide)

if [ $# -ne 1 ]; then
    echo "usage: update.sh v0.91"
    exit 1
fi

new_version=$1

for script in "${scripts[@]}"
do
    for width in "${widths[@]}"
    do
        pkgname="glow-sans-${script}-${width}"
        echo "updating ${pkgname} to ${new_version}."

        # switching branch and remote
        git remote set-url aur "ssh://aur@aur.archlinux.org/$pkgname"
        git fetch aur master
        git checkout -B ${pkgname} aur/master

        # update version
        sed -i "s/pkgver=.*$/pkgver=${new_version}/" PKGBUILD
        updpkgsums
        makepkg --printsrcinfo > .SRCINFO
        git add .
        git commit -m "updates ${pkgname} to ${new_version}"
        git push aur ${pkgname}:master
        echo "updated ${pkgname} to ${new_version}."
    done
done