26 lines
660 B
Bash
Executable file
26 lines
660 B
Bash
Executable file
#!/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
|
|
|