Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 5 insertions, 0 deletions
-rwxr-xr-x.hooks/pre-commit.sh5
diff --git a/.hooks/pre-commit.sh b/.hooks/pre-commit.sh
index ee2143e..235a1f2 100755
--- a/.hooks/pre-commit.sh
+++ b/.hooks/pre-commit.sh
@@ -2,6 +2,11 @@
# When copying/symlinking to .git/hooks/ remember to remove the filename extension!
+if [ -e "index.md" ]; then
+ echo "Refusing to run in a folder that contains an index.md file, since it will be deleted. Are you sure you are running this script from the parent directory of the directory, inside root variable?"
+ exit
+fi
+
root='./src/'
names=('about' 'archives' 'blog' 'docs' 'tutorials' 'reposts')