blob: 116761e7d8898f0924657ed780d07c5dab5674f8 (
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
|
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script requires root privileges. Re-running with sudo..."
exec sudo "$0" "$@"
fi
_pgp_key_name="linux-maintainers@warp.dev"
_do_install() {
_do_remove && \
pacman-key -r "${_pgp_key_name}" --keyserver hkp://keys.openpgp.org:80 && \
pacman-key --lsign-key "${_pgp_key_name}" && \
echo '[warpdotdev]
Server = https://releases.warp.dev/linux/pacman/\$repo/\$arch' >> /etc/pacman.conf && \
pacman -Syu --noconfirm warp-terminal || echo '
############DONE############
Repo configureed, please run
pacman -Syu warp-terminal
to install the warp-terminal
############DONE############
'
}
_do_remove() {
awk '/^\[warpdotdev\]/ {flag=1} /^\[.*\]/ && !/\[warpdotdev\]/ {flag=0} !flag' /etc/pacman.conf > /etc/pacman.conf.new && \
mv /etc/pacman.conf.new /etc/pacman.conf && \
pacman-key -d "${_pgp_key_name}" || true
}
post_install() {
_do_install
}
post_upgrade() {
_do_install
}
post_remove() {
_do_remove
}
|