Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for installing just the trash shell script #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mellbourn
Copy link

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.

About how only the `trash` script could be installed.
@morgant
Copy link
Owner

morgant commented Apr 9, 2021

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.

@Mellbourn
Copy link
Author

Mellbourn commented Apr 9, 2021

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.

@morgant
Copy link
Owner

morgant commented Apr 9, 2021

Very fair points about the benefits of using zsh plugin manager one-liners. Thanks again!

morgant added a commit that referenced this pull request Apr 10, 2021
@morgant
Copy link
Owner

morgant commented Apr 10, 2021

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!

@Mellbourn
Copy link
Author

@danielbayley that link gives me 404

@danielbayley
Copy link

danielbayley commented Feb 12, 2023

@danielbayley that link gives me 404

@Mellbourn Homebrew/homebrew-core#123002

@WybeBosch
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants