Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit57b1b655638886cfa95832db2d0a6e3b2dc2634e (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-07-04 16:54:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-07-04 16:54:05 +0300
Files792f8f34ea8ac41b8dae93e1ac5ec4d182ab4c53
syndamia.com-57b1b655638886cfa95832db2d0a6e3b2dc2634e.tar
syndamia.com-57b1b655638886cfa95832db2d0a6e3b2dc2634e.tar.gz
syndamia.com-57b1b655638886cfa95832db2d0a6e3b2dc2634e.zip
Parent2e996cca84978995f83611e5f0f81c5f45f60ab7 (diff)
pre-commit script will now not run if called in a folder with index.md file
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')