aboutsummaryrefslogtreecommitdiff
path: root/wiki
blob: 67d30004233e91d0e6f85a9987abe06d9828de47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

WIKIPATH=/home/hugo/wiki/public/

# 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 $WIKIPATH

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
		;;
	g|go)
		wiki commit
		wiki push
		;;
	*)
		eval "git $@"
		;;
esac