From afd9fdf7ca0800c457959b540c4378d20f802dc0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 19 May 2021 19:46:20 +0100 Subject: add git package --- packages/git.source.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/git.source.sh (limited to 'packages/git.source.sh') 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 - +} -- cgit v1.2.3