mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
16 lines
408 B
Bash
Executable file
16 lines
408 B
Bash
Executable file
#!/bin/zsh
|
|
|
|
set -e # bail on errors
|
|
|
|
BLOG_PATH="$1"
|
|
ORIGIN_BLOG_PATH="${BLOG_PATH}-origin.git"
|
|
if [[ -e "$BLOG_PATH" ]]; then
|
|
echo ">>> Refusing to clobber $BLOG_PATH"
|
|
else
|
|
if [[ ! -e "$ORIGIN_BLOG_PATH" ]]; then
|
|
echo ">>> Mirroring local origin..."
|
|
git clone --mirror . "$ORIGIN_BLOG_PATH"
|
|
fi
|
|
echo ">>> Cloning test blog from local origin..."
|
|
git clone "$ORIGIN_BLOG_PATH" "$BLOG_PATH"
|
|
fi
|