tools-osx
tools-osx copied to clipboard
Add instructions for installing just the `trash` shell script
Some, like me, are only interested in the trash
shell script, and this documents one way of installing just that, without any build procedure.
This trash
command is, in my opinion, the best one out there for macOS. However, others are more easily installed (e.g. through brew install trash
) and are therefore, unfortunately, more widely used.
First, my apologies for my delay in reviewing this. Many thanks for your praise of my trash
command and for your PR.
I do agree that I should be offering instructions for installing just individual tools one wants, esp. since some tools like dict
are no longer compatible with modern releases of macOS. That said, I still want to support users of older releases and so I probably don't want to provide a zsh
-only solution.
Normally I'd suggest a simple install -b -m 755 src/trash /usr/local/bin
as that's what the Rakefile
is doing. There could be conflicts with other trash commands, but even the Rakefile
is not taking that into consideration except for performing backups of the original file if it already exists (install -b
).
I also could update the Rakefile
to support specifying which tool(s) to install/uninstall.
I think this trash
script deserves more fame than it currently has. Most macOS users looking for similar functionality probably just stumble on the trash
command that is installed by brew install trash
. However, that command has regressed. For quite a while now, it no longer defaults to using the Finder to do the erasing, so it doesn't have the Put back
functionality. If you force it to use the Finder (you can with a flag) it regularly crashes!
You are of course correct that it is possible to install only the trash
script by just downloading it and then doing install -b -m 755 src/trash /usr/local/bin
, which is fairly simple.
Modern zsh plugin managers do have some further features: They automate the downloading and placing of the script, and they automate the process of checking for updates of the script.
So adding documentation on a one-liner that installs using a plugin manager could be useful.
Since the trash
script is just a shell script, it seems overkill to use a Rakefile
for it.
Now, zinit is just one of many plugin managers, and it is one of the more advanced, and thus trickier to configure, but it happens to be the one that I use. Most other plugin-managers will have an even simpler one-liner. For example, I believe, zplug would be zplug "morgant/tools-osx", as:command, use:"src/trash"
(not tested)
That being said, you certainly don't need to use my particular PR. It was just a suggestion on how documentation could be done.
Very fair points about the benefits of using zsh
plugin manager one-liners. Thanks again!
I've updated the Rakefile
to support installing individual tools, plus updated the README regarding that and using zsh
plugin managers. I haven't added the zplug example yet, so will leave this open until I or someone else can confirm that.
Thanks again, @Mellbourn!
@danielbayley that link gives me 404
@danielbayley that link gives me 404
@Mellbourn https://github.com/Homebrew/homebrew-core/pull/123002
Still interested in this, it seems that the homebrew integration was held up because the bot auto closed the pr merge? All the other trash cli dont use the actual macos trash folder, or if they do you cant use Put Back, which is why im still interested in the integration of this repo into the homebrew ecosystem.