aboutsummaryrefslogtreecommitdiff
path: root/task-git.sh
diff options
context:
space:
mode:
authorKosta Harlan <kostajh@gmail.com>2013-09-02 16:30:44 -0400
committerKosta Harlan <kostajh@gmail.com>2013-09-02 16:30:44 -0400
commit9b7388a4a748067a2fe631ed15eff1ed8dfdf385 (patch)
treed48ff2a81f7900b59f531ff04b05db63a3f313c0 /task-git.sh
parent2bbdf4f80969aced6fc5f732cce1fdb0108be7b0 (diff)
downloadtask-git-9b7388a4a748067a2fe631ed15eff1ed8dfdf385.tar.xz
task-git-9b7388a4a748067a2fe631ed15eff1ed8dfdf385.zip
Use existing data dir as repo, update README, and option to push to remote. Fixes #1 and #2
Diffstat (limited to 'task-git.sh')
-rwxr-xr-xtask-git.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/task-git.sh b/task-git.sh
index 24b9f9c..620e197 100755
--- a/task-git.sh
+++ b/task-git.sh
@@ -10,17 +10,17 @@ if [ ! -d "$DATA_DIR" ]; then
echo 'Could not load data directory!'
exit 1
fi
-# The backup directory is stored alongside the existing data directory.
-BACKUP_DIR="${DATA_DIR}.bak"
+
# Create backups
-DATA_DIR_FILES="${DATA_DIR}/*"
-mkdir -p $BACKUP_DIR
-cp -R $DATA_DIR_FILES "${BACKUP_DIR}/"
-cd $BACKUP_DIR
-git add .
-git commit -m "$TASK_COMMAND" > /dev/null
/usr/bin/task $@
-cp -R $DATA_DIR_FILES "${BACKUP_DIR}/"
+cd $DATA_DIR
git add .
git commit -m "$TASK_COMMAND" > /dev/null
+# Check if --task-git-push is passed as an argument.
+for i
+do
+ if [ "$i" == "--task-git-push" ]; then
+ git push origin master
+ fi
+done
exit 0