git

My personal website source code
Log | Files | Refs | Submodules | README | LICENSE

commit 3f9cd249869e93540e93570db0c63db0a6eadab4
parent 0ad4f4eeaa84026447fd765cf606530bebf3c6c3
Author: Luís Ferreira <[email protected]>
Date:   Tue, 18 Jan 2022 15:43:54 +0000

feat: Add support for git repo clone

Signed-off-by: Luís Ferreira <[email protected]>

Diffstat:
MMakefile | 1+
Ascripts/generate-git.sh | 16++++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -18,6 +18,7 @@ build-hugo: postscript-build: ./scripts/ignore-files.sh + ./scripts/generate-git.sh serve-hugo: gen-lastupdate serve-hugo: diff --git a/scripts/generate-git.sh b/scripts/generate-git.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +(cd public/git/ || exit + # echo "$(git rev-parse --git-dir)" + if [ "$(git rev-parse --git-dir)" == "." ]; then + git fetch + else + TEMP_DIR="$(mktemp -d)" + git clone --bare https://github.com/ljmf00/lsferreira.net "$TEMP_DIR" + mv "$TEMP_DIR"/* . + fi + GIT_DIR=. git worktree add file master + + stagit . + cp log.html index.html +)