From 57b1b655638886cfa95832db2d0a6e3b2dc2634e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 4 Jul 2022 16:54:05 +0300 Subject: pre-commit script will now not run if called in a folder with index.md file --- .hooks/pre-commit.sh | 5 +++++ 1 file changed, 5 insertions(+) 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') -- cgit v1.3.1-26-gb76a