diff options
| author | Paul Buetow <git@mx.buetow.org> | 2021-05-19 20:19:52 +0100 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-05-21 05:11:05 +0100 |
| commit | d354a3ffb999c27ece66f8a66dfb416e5d5d7b6c (patch) | |
| tree | f82ea12f1636eb86f5d088aff80f401f979469dc /packages/git.source.sh | |
| parent | 202f4e03fb9519931142fcd3d76700aeb106a05d (diff) | |
add GIT_PUSH
Diffstat (limited to 'packages/git.source.sh')
| -rw-r--r-- | packages/git.source.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/git.source.sh b/packages/git.source.sh index ec8e853..9ee238c 100644 --- a/packages/git.source.sh +++ b/packages/git.source.sh @@ -27,5 +27,19 @@ git::commit () { 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 + local -r message="$1"; shift + + cd "$content_dir" &>/dev/null + git commit -a -m "$message" cd - &>/dev/null } |
