summaryrefslogtreecommitdiff
path: root/uninit.d/50vcs-uninit
blob: eb9f13ac0d80f151938ed6c2195d08c8c2c48120 (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
#!/bin/sh
set -e

if [ "$VCS" = git ]; then
	rm -rf .git
	file=.gitignore
elif [ "$VCS" = hg ]; then
	rm -rf .hg
	file=.hgignore
elif [ "$VCS" = bzr ]; then
	rm -rf .bzr
	file=.bzrignore
elif [ "$VCS" = darcs ]; then
	rm -rf _darcs
	file=.darcsignore
fi

managed_by_etckeeper="managed by etckeeper"

if ! grep -q "$managed_by_etckeeper" "$file"; then
	echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not removing"
else
	rm -f $file
fi