From d354a3ffb999c27ece66f8a66dfb416e5d5d7b6c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 19 May 2021 20:19:52 +0100 Subject: add GIT_PUSH --- README.md | 5 +++-- buetow.org.sh | 25 ++++++++++--------------- packages/git.source.sh | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index dedc829f..c0359204 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This is the source code of my Gemini capsule. You can reach the site(s) here: # Usage -To get started just clone this repo (master branch) and run ./buetow.org.sh. You +To get started just clone this repo (master branch) and run `./buetow.org.sh`. You will will be prompted with further instructions. Once done, you can edit the Gemtext source and then use the buetow.org.sh script @@ -32,7 +32,7 @@ to generate the other output formats such as: * Markdown (works also with GitHub pages as you saw) * Meta (that's only generating meta info for the blog post, used for Atom feed generation) -Do a ./buetow.org.sh --help for a list of all available arguments. +Do a `./buetow.org.sh --help` for a list of all available arguments. ## TODO @@ -41,3 +41,4 @@ These are things I want to do with this project in near future: * Speed it up a bit: Make it so, that only changed .gmi files (or changed HTML templates) result into re-generating other formats. * Write a blog post about buetow.org.sh script * Custom alt.buetow.org domain for GitHub page. +* Read through this README and make sure usage and purpose is clear. diff --git a/buetow.org.sh b/buetow.org.sh index ecb70711..4c18334f 100755 --- a/buetow.org.sh +++ b/buetow.org.sh @@ -28,11 +28,13 @@ help () { cat </dev/null } +# Commit all changes +git::commit () { + local -r content_dir="$CONTENT_BASE_DIR/$1"; shift + local -r message="$1"; shift + + cd "$content_dir" &>/dev/null + git commit -a -m "$message" + if [[ "$GIT_PUSH" == yes ]]; then + git pull + git push + fi + cd - &>/dev/null +} + # Commit all changes git::commit () { local -r content_dir="$CONTENT_BASE_DIR/$1"; shift -- cgit v1.2.3