npm run deploy ignore hooks
Asked Answered
A

1

1

I was getting below error while committing the changes.

enter image description here

Simply adding .pre-commit-config.yaml file or deleting .git\hooks folder was not resolving my problem. So I added --no-verify option while committing and it solved my problem.

Now, I am trying to deploy my react app to Github Pages. When I run npm run deploy I get the same error as shown in the below picture.

enter image description here

How I can add --no-verify option while npm run deploy? Simply adding .pre-commit-config.yaml file or deleting .git\hooks folder is not resolving the problem.

I don't want to try pre-commit uninstall command because the command might uninstall the pre-commit globally.

Is there any alternative to disable the hooks locally specific to the current repository?

Edit: I tried pre-commit uninstall as well. Still throws the same error when I do npm run deploy.

Appal answered 21/6, 2020 at 4:16 Comment(4)
What is the content of c:\dev\react-apps\find-my-event\.git\hooks?Vanvanadate
hooks folder contains only pre-commit file.Appal
as in "pre-commit.sample" or "pre-commit"? Because if you rename pre-commit in pre-commit.xxx, you will desactivate it.Vanvanadate
It is "pre-commit"Appal
V
2

That message should come from c:\dev\react-apps\find-my-event\.git\hooks\pre-commit

For testing, you can rename pre-commit to pre-commit.old and see if the npm run deploy is still affected by the same error message.

That being said, if you are using the pre-commit/pre-commit python frmaework for managing and maintaining multi-language pre-commit hooks., then issues 457 cleary states:

You need one of those to tell pre-commit what hooks you want to run.
To see how to configure one, see http://pre-commit.com

For instance, at a minimum:

  • Create a file named .pre-commit-config.yaml
  • you can generate a very basic configuration using pre-commit sample-config
Vanvanadate answered 21/6, 2020 at 14:20 Comment(2)
After executing pre-commit uninstall, .git\hooks\pre-commit file get deleted. but still throws the same error on npm run deploy.Appal
@Appal OK. I dod not realize you were using pre-commit.com. I have edited my answer.Vanvanadate

© 2022 - 2024 — McMap. All rights reserved.