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 153 forks source link

[BUG] Install with --force Flag Overwrites pre-commit.old #162

Open chriskoelle opened 2 years ago

chriskoelle commented 2 years ago

Running yarn install --force after installing pre-commit causes the pre-commit.old backup to get overwritten by the pre-commit file from this repo

Steps to Reproduce

  1. In a new repo, create a pre-commit file with some dummy content
    #!/bin/bash
    echo "Hello World" && exit 0
  2. Install pre-commit yarn add pre-commit
  3. Notice the pre-commit file is backed up to pre-commit.old
  4. Run install with the force flag yarn install --force

Actual Result

Expected Result

One or both of these options would work: