Verbose on the sending tar, quiet on the receiving tar, so the file list prints once. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
949 B
Bash
Executable File
50 lines
949 B
Bash
Executable File
#!/bin/bash
|
|
# shellcheck disable=SC2002
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
IFS=$'\n\t'
|
|
|
|
# print useful message on failure
|
|
trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
|
|
|
|
# shellcheck disable=SC2034
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
# cd "$DIR"
|
|
here="$PWD"
|
|
|
|
"$DIR/update-cached-repository.sh"
|
|
|
|
# repository="${2:-https://gitea.philologue.net/philologue/diachron}"
|
|
repository="${2:-$HOME/.cache/diachron/v1/repositories/diachron.git}"
|
|
ref="${1:-hydrators-kysely}"
|
|
|
|
echo will bootstrap ref "$ref" of repo "$repository"
|
|
|
|
into=$(mktemp -d)
|
|
cd "$into"
|
|
echo I am in $(pwd)
|
|
echo I will clone repository "$repository", ref "$ref"
|
|
git clone "$repository"
|
|
|
|
r=$(ls -1)
|
|
|
|
cd "$r"
|
|
|
|
echo I am in $(pwd)
|
|
|
|
git checkout "$ref"
|
|
|
|
ls
|
|
echo working dir: $PWD
|
|
# ls backend
|
|
|
|
# exit 0
|
|
|
|
tar cvf - $(cat "$PWD/file-list" | grep -v '^#') | (cd "$here" && tar xf -)
|
|
|
|
echo "$ref" > .diachron-version
|
|
|
|
echo "Now, run the command ./sync.sh"
|