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

Make usable as a ZSH plugin (simply adds to PATH) This also hard codes the python scripts with the abspath to the osx python interpreter, that way homebrew doesn't get in the way and such. #1

Closed
wants to merge 3 commits into from

Conversation

akatrevorjay
Copy link

One rather large change is the removal of extensions, since they were a bit counter-intuitive, at least for me.

@liyanage
Copy link
Owner

liyanage commented Jun 10, 2016

Thanks for the patch. Unfortunately it is a bit too disruptive so I won't merge most of it for these reasons:

  • I prefer the extensions present, also if anybody cloned or copied them and uses them in scripts, it will cause a lot of breakage for no real benefit
  • The indirection for the Python interpreter is actually a desirable feature, precisely so people can override it with things like homebrew

I'll be happy to take the "macosx-shell-scripts.plugin.zsh" patch, can you explain a bit more what that does?

@akatrevorjay
Copy link
Author

I had a feeling that may be the case. To be honest I only created the PR in quick hindsight!

Sure, the plugin.zsh file just allows zsh frameworks to download and include these scripts into their path easily, some examples:

https://github.com/zplug/zplug
https://github.com/tarjoilija/zgen

@akatrevorjay
Copy link
Author

If you want you can cherry pick it out, or I can split it apart sometime over the next day or two.

@akatrevorjay
Copy link
Author

akatrevorjay commented Jun 10, 2016

IMO, you may want to consider also nabbing the force to use OSX python portions (shebang hard-code), as any other python installed will not work with most of these. If you install python from brew for instance, or even pyenv, they won't work as they rely on compiled python extensions that come with osx (but I'm sure you know all of this, I'm more posting the reasoning for posterity)

@@ -0,0 +1,2 @@
#!/bin/zsh
path+=("${0:h}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is loaded automagically via any ZSH framework upon instantiation. ZSH treats path as an array view on your standard PATH variable, so this just appends PATH with a single element. $0 is of course the script name, and the modifier :h is equivalent to dirname

@akatrevorjay akatrevorjay closed this by deleting the head repository Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants