forked from Comcast/xGitGuard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create an installer for the pre-commit hook
- Loading branch information
Parris, Stephen
authored and
Parris, Stephen
committed
Nov 22, 2023
1 parent
ddfbd89
commit 015c86e
Showing
4 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pyinstaller ../git-precommit-hook/xgitguard_precommit_cred_detections.py --hidden-import=sklearn.feature_extraction.text --hidden-import=urlextract --hidden-import=sklearn.model_selection --hidden-import=sklearn.ensemble | ||
|
||
zip -r xgitguard-precommit-hook.zip pre-commit | ||
cd dist/xgitguard_precommit_cred_detections | ||
zip -r ../../xgitguard-precommit-hook.zip xgitguard_precommit_cred_detections | ||
zip -r ../../xgitguard-precommit-hook.zip _internal | ||
chmod 777 ../../xgitguard-precommit-hook.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
results=$(python3 /Users/sparri919/Documents/GitHub/xGitGuard/xgitguard/git-precommit-hook/precommit_cred_detections.py -l 40) | ||
results=$(~/gitconfig/hooks/xgitguard_precommit_cred_detections) | ||
echo "$results" | ||
if grep -q "no-verify" <<< "$results"; then | ||
exit 1; | ||
else | ||
exit 0; | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
git config --global ~/gitconfig | ||
mkdir -p ~/gitconfig | ||
mkdir -p ~/gitconfig/hooks | ||
unzip xgitguard-precommit-hook.zip -d ~/gitconfig/hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters