install.fairie/dotfiles/.local/bin/update-local-betelgeuse

19 lines
937 B
Bash

#!/usr/bin/env bash
if [ -f '/etc/qubes-release' ]; then
# Qubes dom0
qvm-create --label red --template debian-11 provision &> /dev/null || EXIT_CODE=$?
qvm-run --pass-io provision 'rm -f ~/Downloads/betelgeuse-master.tar.gz && curl -sSL https://gitlab.com/megabyte-labs/misc/betelgeuse/-/archive/master/betelgeuse-master.tar.gz > /tmp/betelgeuse-master.tar.gz'
qvm-run --pass-io provision "cat /tmp/betelgeuse-master.tar.gz" > "/tmp/betelgeuse-master.tar.gz"
cd /tmp
tar -xvf betelgeuse-master.tar.gz > /dev/null
rm betelgeuse-master.tar.gz
cp -rf betelgeuse-master/share/ "$HOME/.local/share"
rm -rf betelgeuse-master
else
curl -sSL https://gitlab.com/megabyte-labs/misc/betelgeuse/-/archive/master/betelgeuse-master.tar.gz > betelgeuse-master.tar.gz
tar -xzf betelgeuse-master.tar.gz > /dev/null
rm betelgeuse-master.tar.gz
cp -rf betelgeuse-master/share/ "$HOME/.local/share"
rm -rf betelgeuse-master
fi