diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2018-10-04 11:45:33 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2018-10-04 11:45:33 +0200 |
commit | f7f85822978208e2e84430dd09b336628be99d6d (patch) | |
tree | 3ae909fab36573feadcb0f12acba15e3c23f351a /wiki | |
parent | Thu, 04 Oct 2018 11:41:21 +0200 (diff) | |
download | wiki-public-f7f85822978208e2e84430dd09b336628be99d6d.tar.gz wiki-public-f7f85822978208e2e84430dd09b336628be99d6d.tar.xz |
Add management script.
Diffstat (limited to 'wiki')
-rwxr-xr-x | wiki | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -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 |