aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/makerelease.sh
blob: 801d8a23eddf4deacc674332a2bafa2abbbe538c (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
#!/bin/sh

srcdir="$(realpath "$0" | xargs dirname)"
srcdir="$srcdir/.."

# Import the makerelease.lib
# https://bues.ch/cgit/misc.git/tree/makerelease.lib
die() { echo "$*"; exit 1; }
for path in $(echo "$PATH" | tr ':' ' '); do
	[ -f "$MAKERELEASE_LIB" ] && break
	MAKERELEASE_LIB="$path/makerelease.lib"
done
[ -f "$MAKERELEASE_LIB" ] && . "$MAKERELEASE_LIB" || die "makerelease.lib not found."

hook_get_version()
{
	local file="$1/ui/pyrazer/main.py"
	version="$(cat "$file" | grep -e RAZER_VERSION | head -n1 | cut -d'"' -f2)"
}

hook_post_checkout()
{
	default_hook_post_checkout "$@"

	# Remove firmware directory from release.
	rm -r "$1/firmware"
}

project=razercfg
makerelease "$@"
bues.ch cgit interface