File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Check for updates to files ending with "pro.py"
4
+ if git diff --cached --name-only | grep -E ' pro.py' ; then
5
+ echo " HOOK Error: You have made updates to files ending with 'pro.py' it's forbidden."
6
+ echo " Please remove or revert these changes before committing."
7
+ exit 1
8
+ fi
9
+
10
+ exit 0
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ if errorlevel 1 (
8
8
exit /b 1
9
9
)
10
10
11
+ copy .\.github\hooks\pre-commit .\.git\hooks\
12
+
11
13
echo Installing missing packages...
12
14
call %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
13
15
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ function kill_by_port() {
66
66
kill -9 $pid
67
67
}
68
68
69
+ cp .github/hooks/pre-commit .git/hooks/
70
+
69
71
kill_by_port $( get_config_value " FRONTEND_PORT" )
70
72
kill_by_port $( get_config_value " BACKEND_PORT" )
71
73
You can’t perform that action at this time.
0 commit comments