Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Add build command #89

Open
wants to merge 1 commit into
base: hugo
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions replace-site
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -o errexit

if [ "$#" -ne 1 ]; then
cat <<EOF
Usage: replace-site TARGET_BRANCH

Replaces the branch specified with the contents of '/docs'.
EOF
exit 1
fi

TARGET_BRANCH="$1"
ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)

git checkout "$TARGET_BRANCH"
find . -not -path '*/\.*' -delete
git checkout "$ORIGINAL_BRANCH" -- docs
mv docs/* .
rmdir docs