chriswalz / bit

Bit is a modern Git CLI
Apache License 2.0
6.05k stars 106 forks source link

`bit` doesn't detect whether it was installed via package manager #76

Closed yermulnik closed 3 years ago

yermulnik commented 3 years ago

Describe the bug bit doesn't detect whether it was installed via package manager (brew in this case) and running but update just silently overwrites the symlink in /usr/local/bin/

To Reproduce

  1. Run bit update
  2. Check whether /usr/local/bin/bit is still a symlink

Expected behavior bit detects it was installed via package manager (e.g. by checking some common location which is used by most package managers to keep track of packages installed by their means or e.g. by creating auxiliary file when installed manually) and declines to do a self-update with a self-exlanatory message with optional prompt to force the update and replacement of the already installed file.

Screenshots

11:58:58 [georgii_iermulnik@epuakyiw4608][j:0][~]> sudo bit update
Bit is supported through donations. Consider donating here: ❤ https://github.com/sponsors/chriswalz
Updated bit v0.8.0 to v0.9.1 in /usr/local/bin11:59:32 [georgii_iermulnik@epuakyiw4608][j:0][~]>

Desktop (please complete the following information):

Additional context (Add any other context about the problem here) First reported in #63

chriswalz commented 3 years ago

@yermulnik This one was a bit hard to test but I added a symlink check. If bit is symlinked it will suggest brew upgrade

chriswalz commented 3 years ago

Please reopen if this doesn't work. Thanks for reporting it.

yermulnik commented 3 years ago

@chriswalz Thank you

This one was a bit hard to test

Yep, I do understand. Thanks for fixing for brew but I think there still will be an issue with other package managers where e.g. apt on Ubuntu and pkg on FreeBSD install bit into a PATH as binary but not as symlink.

yermulnik commented 3 years ago

I'll re-open this issue if I have an idea on how to add a check for this kind of package managers.