diff options
| author | Paul Buetow <git@mx.buetow.org> | 2021-05-19 19:46:20 +0100 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-05-21 05:11:05 +0100 |
| commit | afd9fdf7ca0800c457959b540c4378d20f802dc0 (patch) | |
| tree | 64de9c542cbf2c4581c9fc853aeffc105a031111 /packages/git.source.sh | |
| parent | 95f01eeb99f142fcb8192f5f3368c64cef362f1a (diff) | |
add git package
Diffstat (limited to 'packages/git.source.sh')
| -rw-r--r-- | packages/git.source.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/git.source.sh b/packages/git.source.sh new file mode 100644 index 0000000..1484e93 --- /dev/null +++ b/packages/git.source.sh @@ -0,0 +1,31 @@ +# Add a static content file to git +git::add () { + local -r content_dir="$CONTENT_BASE_DIR/$1"; shift + local file="$1"; shift + file=${file/$content_dir/} + + cd $content_dir + echo git add $file + cd - +} + +# Remove a static content file from git +git::rm () { + local -r content_dir="$CONTENT_BASE_DIR/$1"; shift + local file="$1"; shift + file=${file/$content_dir/} + + cd $content_dir + echo git rm $file + cd - +} + +# Commit all changes +git::commit () { + local -r content_dir="$CONTENT_BASE_DIR/$1"; shift + local -r message="$1"; shift + + cd $content_dir + echo git commit -a -m "$message" + cd - +} |
