Skip to content

Commit 73dd526

Browse files
committed
feat(button): readme
1 parent ae3110e commit 73dd526

File tree

1 file changed

+67
-67
lines changed

1 file changed

+67
-67
lines changed

README.md

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -39,75 +39,75 @@ It is client side so the users browser will do the work.
3939
- TELBlazor\TELBlazor.Components.ShowCase.E2ETests\bin\Debug\net8.0\playwright.ps1 need to be run as admin
4040
- local hook for commits, recommended for pre commit, and pre push as can only check the commit name value post commit
4141

42-
`
43-
# --- Commitlint Logic (force local config) ---
44-
REPO_ROOT=$(git rev-parse --show-toplevel)
45-
CONFIG_PATH="$REPO_ROOT/.commitlintrc.json"
46-
echo "COMMIT_MSG_FILE is one msg behind it is only set to the commit your trying to commit after the commit succeeds so this script is one behind"
47-
echo "so would work best in prepush template"
48-
COMMIT_MSG_FILE="$REPO_ROOT/.git/COMMIT_EDITMSG"
49-
50-
# Check if the local .commitlintrc.json exists in the repository root
51-
if [ -f "$CONFIG_PATH" ]; then
52-
53-
echo "✅ Local .commitlintrc.json found at: $CONFIG_PATH. Running commitlint..."
54-
echo "⚠️ if commit lint fails in precommit its actually reading previous commit name you need to reset or squash make a new commit and change .git/COMMIT_EDITMSG to something that would pass. ⚠️"
55-
56-
if command -v npx &> /dev/null; then
57-
58-
cd "$REPO_ROOT" || exit 1
59-
60-
# Debug: Print the commit message file content
61-
if [ -f "$COMMIT_MSG_FILE" ]; then
62-
echo "Commit message content:"
63-
cat "$COMMIT_MSG_FILE"
64-
else
65-
echo "❌ Commit message file not found!"
42+
```
43+
# --- Commitlint Logic (force local config) ---
44+
REPO_ROOT=$(git rev-parse --show-toplevel)
45+
CONFIG_PATH="$REPO_ROOT/.commitlintrc.json"
46+
echo "COMMIT_MSG_FILE is one msg behind it is only set to the commit your trying to commit after the commit succeeds so this script is one behind"
47+
echo "so would work best in prepush template"
48+
COMMIT_MSG_FILE="$REPO_ROOT/.git/COMMIT_EDITMSG"
49+
50+
# Check if the local .commitlintrc.json exists in the repository root
51+
if [ -f "$CONFIG_PATH" ]; then
52+
53+
echo "✅ Local .commitlintrc.json found at: $CONFIG_PATH. Running commitlint..."
54+
echo "⚠️ if commit lint fails in precommit its actually reading previous commit name you need to reset or squash make a new commit and change .git/COMMIT_EDITMSG to something that would pass. ⚠️"
55+
56+
if command -v npx &> /dev/null; then
57+
58+
cd "$REPO_ROOT" || exit 1
59+
60+
# Debug: Print the commit message file content
61+
if [ -f "$COMMIT_MSG_FILE" ]; then
62+
echo "Commit message content:"
63+
cat "$COMMIT_MSG_FILE"
64+
else
65+
echo "❌ Commit message file not found!"
66+
exit 1
67+
fi
68+
69+
70+
# Run commitlint, explicitly pointing to the local config and providing the commit message via stdin
71+
OUTPUT1=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --edit="$COMMIT_MSG_FILE" 2>&1)
72+
73+
EXIT_CODE1=$?
74+
# echo "!!!!!!!!!!! OUTPUT1"
75+
# echo "$OUTPUT1"
76+
77+
78+
# OUTPUT2=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from=origin/master --to=HEAD 2>&1)
79+
80+
# EXIT_CODE2=$?
81+
# echo "!!!!!!!!!!! OUTPUT2"
82+
# echo "$OUTPUT2"
83+
84+
# OUTPUT3=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from-last-tag 2>&1)
85+
86+
87+
# EXIT_CODE3=$?
88+
# echo "!!!!!!!!!!! OUTPUT3"
89+
# echo "$OUTPUT3"
90+
91+
92+
93+
#if [ "$EXIT_CODE1" -ne 0 ] || [ "$EXIT_CODE2" -ne 0 ] || [ "$EXIT_CODE3" -ne 0 ]; then
94+
if [ "$EXIT_CODE1" -ne 0 ]; then
95+
echo "❌ Commitlint failed:"
96+
97+
echo "$OUTPUT1"
6698
exit 1
99+
else
100+
echo "✅ Commitlint passed!"
67101
fi
68-
69-
70-
# Run commitlint, explicitly pointing to the local config and providing the commit message via stdin
71-
OUTPUT1=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --edit="$COMMIT_MSG_FILE" 2>&1)
72-
73-
EXIT_CODE1=$?
74-
# echo "!!!!!!!!!!! OUTPUT1"
75-
# echo "$OUTPUT1"
76-
77-
78-
# OUTPUT2=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from=origin/master --to=HEAD 2>&1)
79-
80-
# EXIT_CODE2=$?
81-
# echo "!!!!!!!!!!! OUTPUT2"
82-
# echo "$OUTPUT2"
83-
84-
# OUTPUT3=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from-last-tag 2>&1)
85-
86-
87-
# EXIT_CODE3=$?
88-
# echo "!!!!!!!!!!! OUTPUT3"
89-
# echo "$OUTPUT3"
90-
91-
92-
93-
#if [ "$EXIT_CODE1" -ne 0 ] || [ "$EXIT_CODE2" -ne 0 ] || [ "$EXIT_CODE3" -ne 0 ]; then
94-
if [ "$EXIT_CODE1" -ne 0 ]; then
95-
echo "❌ Commitlint failed:"
96-
97-
echo "$OUTPUT1"
98-
exit 1
99-
else
100-
echo "✅ Commitlint passed!"
101-
fi
102-
else
103-
echo "⚠️ npx not found. Please ensure Node.js and npm are installed to use commitlint."
104-
# Optionally fail here
105-
# exit 1
106-
fi
107-
else
108-
echo "ℹ️ No local .commitlintrc.json found in $REPO_ROOT. Skipping commitlint."
109-
fi
110-
`
102+
else
103+
echo "⚠️ npx not found. Please ensure Node.js and npm are installed to use commitlint."
104+
# Optionally fail here
105+
# exit 1
106+
fi
107+
else
108+
echo "ℹ️ No local .commitlintrc.json found in $REPO_ROOT. Skipping commitlint."
109+
fi
110+
```
111111
- open powershell admin
112112
- go to e2e project bin/Debug/net8
113113
- run the playwright script with "install"

0 commit comments

Comments
 (0)