cashapp / hermit

🐚 Hermit manages isolated, self-bootstrapping sets of tools in software projects.
https://cashapp.github.io/hermit
Apache License 2.0
586 stars 51 forks source link

Install command should not exit with error if packages are already installed #386

Closed dtomasi closed 11 months ago

dtomasi commented 11 months ago

Hi,

I'm using hermit in different projects, where I provide some sort of init scripts to make sure all projects have the same tools installed. However, when I run hermit install with multiple selectors, where some tools are already installed, it fails with an error. My feeling is that this should behave differently and skip the installation of already installed.

Current state

    hermit install \
        go@1.21 \
        pre-commit@latest \
        golangci-lint@latest \
        gitleaks@latest

This results in the following error message:

fatal:hermit: go@1.21 cannot be installed as go@1.21 is already installed

Target state

    hermit install \
        go@1.21 \
        pre-commit@latest \
        golangci-lint@latest \
        gitleaks@latest
info: skipping installation of go@1.21 as it is already installed
info: skipping installation of pre-commit@latest as it is already installed
info: skipping installation of golangci-lint@latest as it is already installed
info: skipping installation of gitleaks@latest as it is already installed
info: skipping installation of enumer@latest as it is already installed

I'll create a PR for this, but I'm not 100% sure if there are any side effects, so I might need some additional input here.