diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-28 12:10:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-28 12:10:13 -0400 |
commit | 9f613899512e2091d2699c7f64b60c0dbdad71a2 (patch) | |
tree | af2fc6eb4ee769b786f2c3422c68560250bd10cc | |
parent | e5742f7ae353f9a675e13fc0b951daeeff82bdae (diff) |
move VCS probing to after we know what ETCKEEPER_DIR is
CWD does not have to be /etc when using etckeeper..
-rwxr-xr-x | etckeeper | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -16,22 +16,6 @@ if [ -e $conf ]; then . $conf fi -if [ -d ".git" ]; then - VCS=git -elif [ -d ".hg" ]; then - VCS=hg -elif [ -d "_darcs" ]; then - VCS=darcs -elif [ -d ".bzr" ]; then - VCS=bzr -fi - -if [ -z "$VCS" ]; then - echo "Please configure a VCS in $conf" >&2 - exit 1 -fi -export VCS - unset GIT_WORK_TREE unset GIT_DIR @@ -107,6 +91,22 @@ fi cd "$ETCKEEPER_DIR" export ETCKEEPER_DIR +if [ -d ".git" ]; then + VCS=git +elif [ -d ".hg" ]; then + VCS=hg +elif [ -d "_darcs" ]; then + VCS=darcs +elif [ -d ".bzr" ]; then + VCS=bzr +fi + +if [ -z "$VCS" ]; then + echo "Please configure a VCS in $conf" >&2 + exit 1 +fi +export VCS + lsscripts() { perl -e ' $dir=shift; |