sherif icon indicating copy to clipboard operation
sherif copied to clipboard

feat?: `--fix` should run install command if fixing version missmatches

Open juliusmarminge opened this issue 2 years ago • 5 comments

when running --fix and fixing a version, I believe sherif should also run the install command for the package manager at use:

CleanShot 2023-11-25 at 18 16 12@2x

juliusmarminge avatar Nov 25 '23 17:11 juliusmarminge

Forgot to reply to this, sorry. I'm not 100% convinced about automatically running <packageManager> install after autofixing. What if it fails to install, should Sherif revert the changes?

QuiiBz avatar Dec 25 '23 13:12 QuiiBz

Maybe a prompt to let the user choose himself?

Would you like Sherif to run `pnpm install` (Y/n)

Willem-Jaap avatar Jan 31 '24 12:01 Willem-Jaap

No please don’t run install. Which package manager should it use? And it also complicates the possibility to run fix in non-interactive mode as well #68

thomasfr avatar Jun 28 '24 20:06 thomasfr

We could add a --install flag that when used along --fix, also runs the install command of your package manager.

QuiiBz avatar Jun 29 '24 07:06 QuiiBz

Ok, @QuiiBz you convinced me that it’s actually a good idea to run install afterwards to update the lockfile as well.

thomasfr avatar Jun 29 '24 07:06 thomasfr

Now released in https://github.com/QuiiBz/sherif/releases/tag/v1.0.0!

QuiiBz avatar Aug 31 '24 13:08 QuiiBz