summarylogtreecommitdiffstats
path: root/update_package
blob: 920276876ca3eac48383ecdddccbf19ddf425530 (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
#!/bin/bash

C="\x1b[0m"
GRN="\x1b[32m"
YEL="\x1b[33m"
BLU="\x1b[34m"
col2="$BLU::$C"

url=https://github.com/Figma-linux/figma-linux
current=`cat current_version`
echo -e "$col2 Getting latest version..." >/dev/stderr
_latest=`basename $(curl -Ls -o /dev/null -w %{url_effective} "$url/releases/latest")`
latest="${_latest:1}"

if [ "$current" = "$latest" ] && [ "$1" != "-f" ]; then
    echo -e "$col2 Current $GRN$current$C is latest, no update required" >/dev/stderr
else
    echo -e "$col2 Changing current version from $YEL$current$C to $GRN$latest$C"
    echo "$latest" > current_version
fi

echo -e "$col2 Writing .SRCINFO file..."
makepkg --printsrcinfo > .SRCINFO

echo -e "$col2 Updating checksums..."
updpkgsums

echo -e "$col2 Done"