marwanhawari / stew

🥘 An independent package manager for compiled binaries.
MIT License
185 stars 14 forks source link

Allow renaming of binaries #7

Closed marwanhawari closed 2 years ago

marwanhawari commented 2 years ago

This PR adds a rename subcommand to allow users to rename binaries. This is preferred over using an alias in your .zshrc or .bashrc because renaming a binary with rename will update the Stewfile.lock.json as well as the binary name itself. This means that commands like stew uninstall <renamedBinary> and stew upgrade <renamedBinary> will work, which is not true if you use an alias.

Users will also automatically be prompted to rename a binary if:

  1. The asset itself is the binary. Often these have names like binary-v0.0.1-darwin-arm64, which is not the name that people want to type into the command line.
  2. If the binary is not automatically detected inside an archived asset (which can happen if 0 or >1 executable files are found in an archive). After selecting the binary, they will be prompted to rename it.

Finally, this PR switch out any usage of the path library in favor of the filepath library which uses / or \ in an operating-system compatible way. path only uses /.

marwanhawari commented 2 years ago

resolves https://github.com/marwanhawari/stew/issues/3