summaryrefslogtreecommitdiff
path: root/etckeeper
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-11-06 00:09:05 -0500
committerJoey Hess <joey@kodama.kitenet.net>2007-11-06 00:09:05 -0500
commita9c4fe62edabb7dbb4970edbe15ba6ed146eba1a (patch)
tree1cdf579f7b5ec3d2f93de7895129217fdb25010d /etckeeper
parentad7202a18498d46420aefba9b0746ea187dd0472 (diff)
rationallised directory handling
Default to cding to /etc, but allow the user to specify another directory to operate on.
Diffstat (limited to 'etckeeper')
-rwxr-xr-xetckeeper6
1 files changed, 3 insertions, 3 deletions
diff --git a/etckeeper b/etckeeper
index 5aa4208..5606b72 100755
--- a/etckeeper
+++ b/etckeeper
@@ -13,10 +13,10 @@ if [ ! -d "/etc/etckeeper/$command.d" ]; then
exit 1
fi
-if [ "$command" = post-apt ] || [ "$command" = pre-apt ]; then
- cd /etc
-elif [ "$command" = pre-commit ] && [ -n "$1" ]; then
+if [ -n "$1" ]; then
cd "$1"
+else
+ cd /etc
fi
run-parts "/etc/etckeeper/$command.d"