summaryrefslogtreecommitdiff
path: root/packages/git.source.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packages/git.source.sh')
-rw-r--r--packages/git.source.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/git.source.sh b/packages/git.source.sh
new file mode 100644
index 00000000..1484e93d
--- /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 -
+}