From f924326baf7118040fc6bb781f5dc2f362284735 Mon Sep 17 00:00:00 2001 From: mustard Date: Mon, 20 Oct 2025 14:01:39 +0200 Subject: [PATCH] Initial commit --- setup.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..133a492 --- /dev/null +++ b/setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -eo pipefail + +# running in guest + +guest_name="$(qubesdb-read /name)" +#guest_repo_dir="$(realpath ""$@"")" +guest_repo_dir="$(dirname $(realpath ""$0""))" +echo $guest_repo_dir +pushd ${guest_repo_dir} >/dev/null + +if git remote | grep -Fq 'dom0'; then + echo "(${guest_name}) remote 'dom0' already exists" >&2 +else + echo "(${guest_name}) setting up remote 'dom0' to pull changes via bundle" >&2 + git remote add dom0 ${guest_repo_dir}/.bundles/dom0.bundle +fi + +branch=$(git branch --show-current) +echo "(${guest_name}) creating bundle for branch '${branch}'" >&2 +mkdir -p .bundles +git bundle create .bundles/domu.bundle "${branch}" + +popd >/dev/null +