Skip to content

Commit

Permalink
misc: update build script to support containers created with apx/dbox…
Browse files Browse the repository at this point in the history
…/tbox
  • Loading branch information
mirkobrombin committed Jan 27, 2024
1 parent ed765a9 commit 158fac5
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
flatpak-spawn --host flatpak run org.flatpak.Builder build com.usebottles.bottles.yml --user --install --force-clean && flatpak-spawn --host flatpak run com.usebottles.bottles
#!/bin/sh

run_flatpak() {
flatpak-spawn --host flatpak run org.flatpak.Builder build com.usebottles.bottles.yml --user --install --force-clean && flatpak-spawn --host flatpak run com.usebottles.bottles
}

run_host() {
flatpak run org.flatpak.Builder build com.usebottles.bottles.yml --user --install --force-clean && flatpak run com.usebottles.bottles
}

run_container() {
host-spawn flatpak run org.flatpak.Builder build 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

0 comments on commit 158fac5

Please sign in to comment.