-
-
Notifications
You must be signed in to change notification settings - Fork 276
/
build.sh
36 lines (28 loc) · 919 Bytes
/
build.sh
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
#!/bin/sh
run_flatpak() {
flatpak-spawn --host flatpak-builder -v build com.usebottles.bottles.yml --user --install --force-clean && flatpak-spawn --host flatpak run com.usebottles.bottles
}
run_host() {
flatpak-builder build -v com.usebottles.bottles.yml --user --install --force-clean && flatpak run com.usebottles.bottles
}
run_container() {
host-spawn flatpak-builder build -v com.usebottles.bottles.yml --user --install --force-clean && host-spawn flatpak run com.usebottles.bottles
}
if [ -x "$(command -v flatpak-spawn)" ]; then
run_flatpak
exit $?
fi
if [ -f "/run/.containerenv" ]; then
if [ -x "$(command -v flatpak)" ]; then
run_host
exit $?
fi
if [ -x "$(command -v host-spawn)" ]; then
run_container
exit $?
fi
echo "Looks like you are running in a container, but you don't have flatpak or host-spawn installed."
echo "Nothing to do here."
fi
run_host
exit $?