Add bootstrap and cached repository scripts
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>
This commit is contained in:
22
update-cached-repository.sh
Executable file
22
update-cached-repository.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user