omni icon indicating copy to clipboard operation
omni copied to clipboard

`up`/`go`: add support to `go install` tools

Open xaf opened this issue 1 year ago • 0 comments

This should support to go install tools at specific versions (or just at the latest). When installed with specific versions, it could avoid calling go install each time and would only enforce the version to be installed.

e.g. instead of having to write:

env:
  MYTOOL_VERSION: vX.Y.Z

up:
- go: auto
- custom:
      name: Install my tool
      met?: command -v mytool@${MYTOOL_VERSION}
      meet: |
        rm -f "${GOBIN}/mytool@"*
        go install path.to/mytool@${MYTOOL_VERSION}
        (cd "${GOBIN}" && ln -sf "./mytool" "./mytool@${MYTOOL_VERSION}")

We could simply write:

up:
  - go:
      version: auto
      go-install:
        - path.to/mytool: vX.Y.Z

And omni would take care of setting up and maintaining the version when omni up is called.

xaf avatar Oct 03 '24 20:10 xaf