Bug when run with husky from atom git gui
See original GitHub issueDescription
When I commit from the cli everything works fine, but when I commit from atom i get this error:
Steps to reproduce
- use atom
- setup to use lint-staged with husky
- try to commit from Atom git gui
Debug Logs
STDERR: 17:22:04.472031 git.c:418
trace: built-in: git rev-parse --verify HEAD
husky > pre-commit hook failed (add --no-verify to bypass)
Command failed: /bin/sh -c lint-staged
after digging around and adding logs I ended up in the staged-git-files
code and I found that when it’s calling node’s child_process.spawn
the PATH is not correctly set.
var cmd = spawn(bits[0], args, {
cwd: module.exports.cwd
});
if I add:
var cmd = spawn(bits[0], args, {
cwd: module.exports.cwd,
env: {
PATH: process.env.PATH
}
});
everything start working again
Environment
- OS: Ubuntu 18.0.4
- Node.js: 10.15.1
lint-staged
: 8.1.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How to fix error 'not found husky-run' when committing new ...
If you're using Husky v4 or lower, do the following: rm -rf .git/hooks npm install ... To fix this in husky version 6...
Read more >20 Git Commands you (probably) didn't know about ♂️
20 Git Commands you (probably) didn't know about ♂️ · Git Web · Git Notes · Git Bisect · Git Grep · Git...
Read more >Introducing a complete toolchain - Learn web development
We've come a long way in this chapter, building up a rather nice local development environment to create an application in.
Read more >atscm - UNPKG
If you find a bug in the source code, you can help us by submitting an issue to this repository. Even better, you...
Read more >@aesop-engineering/gel - npm
Rollup builds ES Modules for this project. The following command will also construct the Typescript declaration files. npm run build. Git ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved my problem by using
npx lint-staged
instead ofint-staged
proposed by @zorzysty in https://github.com/okonet/lint-staged/issues/420#issuecomment-558121775 :Glad you got it solved. I don’t this is directly an issue with lint-staged, so I’ll close the issue.