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

lockfix reverts changes if cannot apply the patch #256

Open
andrew-potachits opened this issue Nov 4, 2022 · 0 comments
Open

lockfix reverts changes if cannot apply the patch #256

andrew-potachits opened this issue Nov 4, 2022 · 0 comments

Comments

@andrew-potachits
Copy link

My repository has multiple projects, some of them are C#, others are nodejs.
The structure is like this:

solution
  some-nodejs-proj
  some-c#-proj
    another-nodejs-proj
...

when some-c#-proj has some changes (C# files, changed and added files), and in another-nodejs-proj I run lockfix -f, it reverts my changes.
I repeated the steps from the lockfix.ts, and figured out that the patch created by git diff --binary HEAD cannot be applied to my working copy, most likely because of UTF BOM in the affected hunks.
however, the tool doesn't report any error about the error for the patch apply, and (which is worse) it doesn't preserve the working copy state.

I would suggest the following improvements to the tool:

  1. don't touch the files other than package-lock.json. It will minimize the potential damage.
  2. make a copy of the files being modified, so they can be restored in case of failure (automatically or manually).
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