observing / pre-commit

Automatically installs a git pre-commit script in your git repository which runs your `npm test` on pre-commit
MIT License
1.88k stars 152 forks source link

Builds aren't added to commit #81

Open hollowdoor opened 7 years ago

hollowdoor commented 7 years ago

What could be done to make sure build files created by pre-commit are added to the stage?

Is this something that can be in pre-commit, or is there something I can do on my end?

For instance I could just add a command to the package.json scripts that stages the built files on pre commit.

rpribadi commented 7 years ago

Facing the same situation. What's the recommendation for this? Thanks!

barvian commented 7 years ago

I agree; this would be a nice option. For now I'm just doing something like:

{
  "scripts": {
    ...
    "build:add": "git add [whatever files related to build]"
  },
  "precommit": [
    "clean",
    "lint",
    "build",
    "build:add"
  ]
}