diff options
| author | Paul Buetow <paul@buetow.org> | 2023-03-18 13:24:09 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-03-18 13:24:09 +0200 |
| commit | 5f42d3b0b6a42f10b39f4a88ff76c7fda6f2a8e4 (patch) | |
| tree | c368645c8ea935ca9f29d7660ef9e9f8d9eb159f | |
| parent | db6bd852dc8e4ad8c41b9489261df6de6a4fba43 (diff) | |
add POST_PUBLISH_HOOK
| -rw-r--r-- | .gitignore | 1 | ||||
| -rwxr-xr-x | gemtexter | 3 | ||||
| -rw-r--r-- | gemtexter.conf | 1 | ||||
| -rw-r--r-- | lib/git.source.sh | 6 |
4 files changed, 8 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52b9848 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +post_publish_hook.sh @@ -156,6 +156,9 @@ main () { --publish) $0 --generate $0 --git + if [ -x "$POST_PUBLISH_HOOK" ]; then + $POST_PUBLISH_HOOK + fi ;; --help|*) help diff --git a/gemtexter.conf b/gemtexter.conf index fa495b4..5b10bf0 100644 --- a/gemtexter.conf +++ b/gemtexter.conf @@ -5,6 +5,7 @@ declare -xr EMAIL='hi@paul.cyou' declare -xr IMAGE_PATTERN='\.(jpg|png|gif)$' declare -xr ATOM_MAX_ENTRIES=42 declare -xr CONTENT_BASE_DIR=../foo.zone-content +declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh declare -xr HTML_HEADER=./extras/html/header.html.part declare -xr HTML_FOOTER=./extras/html/footer.html.part declare -xr HTML_CSS_STYLE=./extras/html/style.css diff --git a/lib/git.source.sh b/lib/git.source.sh index 1a71ade..8048aad 100644 --- a/lib/git.source.sh +++ b/lib/git.source.sh @@ -15,14 +15,14 @@ git::add_all () { git::_content_dirs_in_git | while read -r content_dir; do log INFO "Adding content from $content_dir to git" - git::_add_all "$message" "$content_dir" & + git::_add_all "$message" "$content_dir" done - wait } git::_add_all () { local -r message="$1"; shift local -r content_dir="$1"; shift + local -r pwd="$(pwd)" cd "$content_dir" || log PANIC "Unable to chdir to $content_dir" find . -type f -not -path '*/\.git*' | while read -r file; do @@ -32,7 +32,7 @@ git::_add_all () { local -r format="$(basename "$content_dir")" git commit -a -m "$message for $format" - cd - + cd "$pwd" } git::sync_all () { |
