ci(post-commit): updated to track post-commit
This commit is contained in:
19
commit-config/hooks/install.sh
Executable file
19
commit-config/hooks/install.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROJECT_ROOT=$_4DSSE_ROOT
|
||||
# Check if the project root is set
|
||||
if [ -z "$PROJECT_ROOT" ]; then
|
||||
echo "The 4DSSE root is not set. Please set the _4DSSE_ROOT environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp $PROJECT_ROOT/commit-config/hooks/post-commit $PROJECT_ROOT/.git/hooks/post-commit
|
||||
|
||||
# Make sure the post-commit hook is executable
|
||||
chmod +x $PROJECT_ROOT/.git/hooks/post-commit
|
||||
|
||||
# Check if the post-commit hook was copied successfully
|
||||
if [ ! -f $PROJECT_ROOT/.git/hooks/post-commit ]; then
|
||||
echo "ERROR! The post-commit hook was not copied successfully."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user