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

CI not detected on uninstall #704

Closed
thib3113 opened this issue Apr 8, 2020 · 0 comments · Fixed by #708
Closed

CI not detected on uninstall #704

thib3113 opened this issue Apr 8, 2020 · 0 comments · Fixed by #708

Comments

@thib3113
Copy link

thib3113 commented Apr 8, 2020

Hello,

I'm running gitlab CI (gitlab runner on an ubuntu server) .
Husky version : 4.2.3

And It seems that husky doesn't check if in CI when trying to uninstall it .

In my CI I need to do yarn install, and after npm install, so husky is installed, desinstalled and so reinstalled .

So this just log an error :

ENOENT: no such file or directory, unlink '/home/gitlab-runner/builds/coBbus79/1/API/.git/hooks/husky.local.sh'
husky > Failed to uninstall

In my opinion, you need to check if husky is installed, and just skip the error log if CI ?

Here is the output with debug

husky > Uninstalling git hooks
husky:debug Current working directory is /home/gitlab-runner/builds/coBbus79/1/API/node_modules/husky
husky:debug INIT_CWD is set to /home/gitlab-runner/builds/coBbus79/1/API
husky:debug Git rev-parse command returned:
husky:debug   --git-common-dir: .git
husky:debug   --show-prefix: 
ENOENT: no such file or directory, unlink '/home/gitlab-runner/builds/coBbus79/1/API/.git/hooks/husky.local.sh'
husky:debug Error: ENOENT: no such file or directory, unlink '/home/gitlab-runner/builds/coBbus79/1/API/.git/hooks/husky.local.sh'
    at Object.unlinkSync (fs.js:1052:3)
    at Object.removeLocalScript (/home/gitlab-runner/builds/coBbus79/1/API/node_modules/husky/lib/installer/localScript.js:19:8)
    at Object.uninstall (/home/gitlab-runner/builds/coBbus79/1/API/node_modules/husky/lib/installer/index.js:54:19)
    at run (/home/gitlab-runner/builds/coBbus79/1/API/node_modules/husky/lib/installer/bin.js:78:16)
    at Object.<anonymous> (/home/gitlab-runner/builds/coBbus79/1/API/node_modules/husky/lib/installer/bin.js:88:1)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
husky > Failed to uninstall
husky > Setting up git hooks
husky:debug Current working directory is /home/gitlab-runner/builds/coBbus79/1/API/node_modules/husky
husky:debug INIT_CWD is set to /home/gitlab-runner/builds/coBbus79/1/API
husky:debug Git rev-parse command returned:
husky:debug   --git-common-dir: .git
husky:debug   --show-prefix: 
husky:debug Package manager: npm
CI detected, skipping Git hooks installation.
husky > Done
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 a pull request may close this issue.

1 participant