aboutsummaryrefslogtreecommitdiff
path: root/wiki
blob: 74097e1f77975ba5dfdc3c5f7ab8860c995547e4 (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
43
44
#!/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

command=$1

case $command 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