summaryrefslogtreecommitdiff
path: root/helpers/lh_clean
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-11-12 22:31:06 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:29 +0100
commitb47d0c480df34c1c15ac83166ae246991ce72385 (patch)
tree43a924f6ac714e195bf280d576fcf0686d57a580 /helpers/lh_clean
parent1ef63a83da236e6c949c27140cfa0ee6fc652f17 (diff)
downloadvyos-live-build-b47d0c480df34c1c15ac83166ae246991ce72385.tar.gz
vyos-live-build-b47d0c480df34c1c15ac83166ae246991ce72385.zip
Adding a check to see if user is running lh_clean from a sane location (i.e. not config/), thanks to Kai Hendry <hendry@webconverger.com>.
Diffstat (limited to 'helpers/lh_clean')
-rwxr-xr-xhelpers/lh_clean7
1 files changed, 7 insertions, 0 deletions
diff --git a/helpers/lh_clean b/helpers/lh_clean
index 3fa8fc58a..166c867ce 100755
--- a/helpers/lh_clean
+++ b/helpers/lh_clean
@@ -42,6 +42,13 @@ else
ARGUMENTS="${@}"
fi
+# Avoid cases were users accidentally nuke their config/binary
+if [ ! -d config ] || [ "$(basename ${PWD})" = "config" ]
+then
+ Echo_error "${PWD} is not a good Debian Live working directory to clean."
+ exit 1
+fi
+
for ARGUMENT in ${ARGUMENTS}
do
case "${ARGUMENT}" in