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

[BUG] commitlint blocks committing on Windows #207

Open
EmmaDawsonDev opened this issue Jun 26, 2024 · 1 comment
Open

[BUG] commitlint blocks committing on Windows #207

EmmaDawsonDev opened this issue Jun 26, 2024 · 1 comment

Comments

@EmmaDawsonDev
Copy link
Collaborator

Describe the bug
The lint-commit command "lint-commit": "npx --no-install commitlint --edit \"$1\"", fails on Windows

To Reproduce
Steps to reproduce the behavior:

  1. Make changes and run git commit -m "fix: message
  2. Get error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

$ git commit -m "docs: make instructions clearer"

> [email protected] lint-commit
> npx --no-install commitlint --edit $1

file:///C:/Users/squig/Documents/Dev%20projects/deals-for-devs/node_modules/@commitlint/cli/lib/cli.js:129
        throw err;
        ^

Error: ENOENT: no such file or directory, open 'C:\Users\squig\Documents\Dev projects\deals-for-devs\$1'
    at async open (node:internal/fs/promises:639:25)
    at async Object.readFile (node:internal/fs/promises:1249:14)
    at async getEditCommit (file:///C:/Users/squig/Documents/Dev%20projects/deals-for-devs/node_modules/@commitlint/read/lib/get-edit-commit.js:11:22)
    at async main (file:///C:/Users/squig/Documents/Dev%20projects/deals-for-devs/node_modules/@commitlint/cli/lib/cli.js:183:19) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\squig\\Documents\\Dev projects\\deals-for-devs\\$1'
}

Node.js v20.15.0
husky - commit-msg script failed (code 1)

Desktop (please complete the following information):

  • OS: Windows 11

Suggested Solution
Share you how you plan go about solving this bug.

Additional context
Add any other context about the problem here.

@mibijoy007
Copy link
Contributor

Hi,
I found a solution and it's working for me(win 10). Also tried on ubuntu and works.

Actually discussing it with @jamesqquick

If he confirms I'll do a PR

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

No branches or pull requests

2 participants