question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] run npx simple-git-hooks every time you change a command

See original GitHub issue

Is this a good idea to do something like this?

"simple-git-hooks": {
  "pre-commit": "npx simple-git-hooks && npx lint-staged"
}

so that people don’t need to run npx simple-git-hooks command when the config change

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
glen-84commented, Mar 22, 2021

Couldn’t this be done internally, before each command is run?

Check the hash and/or file modification time of the package.json or configuration file, and if it has changed, re-run setup?

Another idea: Install a post-merge hook that checks for updates to configuration, and if necessary, re-runs setup.

4reactions
Djalercommented, Mar 24, 2021

Also, what about initial hooks install? For example, if I’ll replace husky with simple-git-hooks in my project, I need to say all project members to run npx simple-git-hooks. Doesn’t seem nice to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

simple-git-hooks - npm
Update git hooks command. Change the configuration. Run npx simple-git-hooks from the root of your project. Note for yarn2 users: Please run ......
Read more >
githooks Documentation - Git
Hooks are programs you can place in a hooks directory to trigger actions at certain points in git's execution. Hooks that don't have...
Read more >
How To Use Git Hooks To Automate Development and ...
Git hooks are event-based. When you run certain git commands, the software will check the hooks directory within the git repository to see...
Read more >
Skip pre-commit hook in "npm version" command
From the docs. commit-hooks ... Run git commit hooks when using the npm version command. If you simply want to allow this one...
Read more >
Git Hooks | Learn how to use pre-commit hooks, post-commit ...
Every Git repository has a .git/hooks folder with a script for each hook you can bind to. You're free to change or update...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found