aboutsummaryrefslogtreecommitdiff
path: root/wiki
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2018-10-04 11:45:33 +0200
committerHugo Hörnquist <hugo@hornquist.se>2018-10-04 11:45:33 +0200
commitf7f85822978208e2e84430dd09b336628be99d6d (patch)
tree3ae909fab36573feadcb0f12acba15e3c23f351a /wiki
parentThu, 04 Oct 2018 11:41:21 +0200 (diff)
downloadwiki-public-f7f85822978208e2e84430dd09b336628be99d6d.tar.gz
wiki-public-f7f85822978208e2e84430dd09b336628be99d6d.tar.xz
Add management script.
Diffstat (limited to 'wiki')
-rwxr-xr-xwiki36
1 files changed, 36 insertions, 0 deletions
diff --git a/wiki b/wiki
new file mode 100755
index 0000000..eed28fb
--- /dev/null
+++ b/wiki
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# A simple script for managing a vimwiki git repo.
+# Allows slightly simpler edits and commits.
+
+if [ $# -eq 0 ] || [ $1 = "edit" ]; then
+ vim +VimwikiIndex
+ exit
+fi
+
+pushd ~/vimwiki/
+
+case $1 in
+ commit)
+ shift
+ if [ $# -eq 0 ]; then
+ msg="$(date --rfc-email)"
+ else
+ msg="$@"
+ fi
+ git add -A
+ git commit -m "$msg"
+ ;;
+ ammend)
+ shift
+ if [ $# -eq 0 ]; then
+ git commit --amend
+ else
+ msg="$@"
+ git commit --amend -m "$msg"
+ fi
+ ;;
+ *)
+ eval "git $@"
+ ;;
+esac