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

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

Open
chriskoelle opened this issue Jul 23, 2022 · 0 comments
Open

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

chriskoelle opened this issue Jul 23, 2022 · 0 comments

Comments

@chriskoelle
Copy link

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

  • The pre-commit.old backup contents are overwritten with the pre-commit content from this repo

Expected Result

One or both of these options would work:

  • additional backup files would be created if pre-commit.old already exists (e.g. pre-commit.old-2)
  • a backup file is not created if the contents of pre-commit matches the pre-commit content from this repo
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

No branches or pull requests

1 participant