Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: commitlint blocking commits in windows #282

Conversation

mibijoy007
Copy link
Contributor

@mibijoy007 mibijoy007 commented Sep 14, 2024

Issue

Solving #207

Description

Just changed the .husky/commit-msg form:

npm run lint-commit

to this:

#!/bin/sh
npx --no-install commitlint --edit $1

This works across all platforms as I'm telling it to run the command in sh .

In windows:

npm or npx doesn't treat $1 as shell script in package.json format:

In package.json :

"lint-commit": "npx --no-install commitlint --edit "$1"",

this was the problem

Also

As $git add * ignores .husky/commit-msg I had to do $git add . which will also add the .env file. So I added .env to the .gitignore file. For my machine(win 10) the .env*.local was ignored when doing $git add . and added .env to git tracking

PR Requirements

  • [ X ] I have carefully read through and understand the Deals-for-Devs Contributing Guide
  • [ X ] The title of this PR follows the Conventional Commits format
  • [ X ] The Description gives a good representation of the changes made
  • [ X ] If this PR addresses an open Issue, it is linked in the Issue section

Copy link

vercel bot commented Sep 14, 2024

@mibijoy007 is attempting to deploy a commit to the Learn Build Teach Team on Vercel.

A member of the Team first needs to authorize it.

.gitignore Show resolved Hide resolved
@jamesqquick jamesqquick merged commit ece6a94 into Learn-Build-Teach:dev Sep 25, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants