From a2e49e78a972fd038e38ca8346d6804fd8284760 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 23 Aug 2015 22:06:28 +1000 Subject: [PATCH] Make a script safer It wiped out my .git --- qcsrc/whitespace.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/whitespace.sh b/qcsrc/whitespace.sh index a017dc84f..1e42413a1 100755 --- a/qcsrc/whitespace.sh +++ b/qcsrc/whitespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash - -find . -type f -print0 | \ +cd ${0%[\\/]*} +find . -name .git -prune -o -type f -print0 | \ xargs -0 sed -i \ `# strip trailing spaces` \ -e 's/[[:space:]]*$//' \ -- 2.39.2