-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: update build script to support containers created with apx/dbox…
…/tbox
- Loading branch information
1 parent
ed765a9
commit 158fac5
Showing
1 changed file
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |