bootstrap.sh clones from a local mirror and extracts framework files into the working directory. update-cached-repository.sh maintains the mirror under ~/.cache/diachron/v1/repositories/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
520 B
Bash
Executable File
23 lines
520 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
IFS=$'\n\t'
|
|
|
|
trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
|
|
|
|
upstream=https://gitea.philologue.net/philologue/diachron
|
|
cache_dir="$HOME/.cache/diachron/v1/repositories"
|
|
cached_repo="$cache_dir/diachron.git"
|
|
|
|
mkdir -p "$cache_dir"
|
|
|
|
if [ -d "$cached_repo" ]; then
|
|
echo "Updating cached repository..."
|
|
git -C "$cached_repo" fetch --prune origin
|
|
else
|
|
echo "Creating cached repository..."
|
|
git clone --mirror "$upstream" "$cached_repo"
|
|
fi
|
|
|