-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ref: no-ref): add setup hooks, remove karma (#1340)
* feat(ref: no-ref): add setup hooks, remove carma * feat(ref: no-ref): remove environment * feat(ref: no-ref): fix warnings in console * feat(ref: no-ref): remove cypress from lib folder * feat(ref: no-ref): add text to readme
- Loading branch information
1 parent
779babe
commit ec15f30
Showing
31 changed files
with
1,836 additions
and
863 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
commit_msg=$(cat .git/COMMIT_EDITMSG) | ||
echo "$commit_msg" | npx commitlint |
2 changes: 1 addition & 1 deletion
2
.github/.hooks/pre-commit/quality.sh → .github/hooks/pre-commit
100644 → 100755
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,4 +1,4 @@ | ||
#!/usr/bin | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
|
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,39 @@ | ||
#!/bin/bash | ||
|
||
# Define the directory containing sample hooks | ||
SAMPLE_HOOKS_DIR=".github/hooks" | ||
|
||
# Define the target directory for Git hooks | ||
GIT_HOOKS_DIR=".git/hooks" | ||
|
||
# Function to copy or replace hooks | ||
copy_or_replace_hooks() { | ||
for hook in "$SAMPLE_HOOKS_DIR"/*; do | ||
hook_name=$(basename "$hook") | ||
target_hook="$GIT_HOOKS_DIR/$hook_name" | ||
if [ -f "$target_hook" ]; then | ||
echo "Replacing existing hook: $hook_name" | ||
else | ||
echo "Copying new hook: $hook_name" | ||
fi | ||
cp "$hook" "$target_hook" | ||
chmod ug+x "$target_hook" # Ensure executable permission is set | ||
done | ||
} | ||
|
||
# Main function | ||
main() { | ||
# Check if .git/hooks directory exists | ||
if [ ! -d "$GIT_HOOKS_DIR" ]; then | ||
echo "Error: .git/hooks directory not found. Are you in a Git repository?" | ||
exit 1 | ||
fi | ||
|
||
# Copy or replace hooks | ||
copy_or_replace_hooks | ||
|
||
echo "Git hooks setup complete." | ||
} | ||
|
||
# Run the main function | ||
main |
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
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
Oops, something went wrong.