DEV Community

Rogério Rodrigues de Alcântara
Rogério Rodrigues de Alcântara

Posted on

The One Where [Bottled] Conflicts with: [Formulae] (because both install [Those] binaries)

GoTask is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make - https://taskfile.dev

That (Go|Task)/*/ is just great is no wonder.

What just a few lucky ones would learn, though, is that it might conflict with other binaries, sometimes -  which might not be that great.

brew info go-task
# =>
#     go-task: stable 3.24.0 (bottled), HEAD
#     ..
#     Conflicts with:
#       task (because both install `task` binaries)
Enter fullscreen mode Exit fullscreen mode

A quick workaround is changing the GoTask's binary - in just a few steps..

## unlink `Taskwarrior`
brew unlink task

## install the `GoTask`
brew install go-task

## unlink the `GoTask`
brew unlink go-task

## relink `taskwarrior`
brew link task

## find out the symlinks that Brew ought to create
brew link go-task --dry-run
# =>
#    Would link:
#    /usr/local/etc/bash_completion.d/task
#    /usr/local/bin/task
#    /usr/local/share/fish/vendor_completions.d/task.fish
#    /usr/local/share/zsh/site-functions/_task

## Then manually links the binary as `gotask` - or whatever fits best
ln -s /usr/local/Cellar/go-task/3.24.0/bin/task /usr/local/bin/gotask

## Next, checks the folders under `$FPATH`
echo "${FPATH:?}" | sed 's/:/\n/g' | uniq -c
# =>
#   1 ~/.config/zsh/opt/completions
#   1 /usr/local/share/zsh/site-functions
#   1 /usr/local/Cellar/zsh/5.9/share/zsh/functions

## Copy the shell-completion file to any directory listed in `$FPATH`
## while applying a few changes
cat /usr/local/Cellar/go-task/3.24.0/share/zsh/site-functions/_task | sed s/task/gotask/g > ~/.config/zsh/opt/completions/_gotask

## Finally, resource ZSH files - or restart the terminal
exit
Enter fullscreen mode Exit fullscreen mode

And presto!

Id' just ensure that the binary is working just fine..

## after all, this is IT and not - you know - exact science!
gotask --version
# =>
#   Task version: 3.24.0

## And don't forget the completions..
## for anybody who, like me, may have no life but.. **_TAB!_**
gotask
# =>
#   |  build
#   |  format
#   |  lint
#   |> nobody?
Enter fullscreen mode Exit fullscreen mode

Well Done… GIF by CRThaze | Gfycat

Watch and share Well Done GIFs by CRThaze on Gfycat

favicon gfycat.com

I wonder whether a similar approach would potentially work out for similar formulae. To be continued..

REFERENCES

Top comments (0)