summarylogtreecommitdiffstats
path: root/openasar-git.install
blob: c39905fd7b80df387119639d646660d709c1eef1 (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
post_install() {
	_pkgname='openasar'
	pkgname="${_pkgname}-git"
	default_asar_path="${pkgdir}/opt/discord/resources/app.asar"
	if [ -f "$default_asar_path" ]; then
		cp "${default_asar_path}" "${default_asar_path}.backup"
		cp "/opt/${pkgname}/app.asar" "${default_asar_path}"
	fi
}

pre_upgrade() {
	default_asar_path="${pkgdir}/opt/discord/resources/app.asar"
	if [ -f "$default_asar_path" ]; then
		rm "${default_asar_path}"
	fi
}

post_upgrade() {
	_pkgname='openasar'
	pkgname="${_pkgname}-git"
	default_asar_path="${pkgdir}/opt/discord/resources/app.asar"
	if [ -f "${default_asar_path}.backup" ]; then
		cp "/opt/${pkgname}/app.asar" "/opt/discord/resources/app.asar"
	fi
}

post_remove() {
	default_asar_path="/opt/discord/resources/app.asar"
	if [ -f "${default_asar_path}.backup" ]; then
		mv "${default_asar_path}.backup" "${default_asar_path}"
	fi
}