Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Allow enable.sh to work with zsh #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kevinywlui
Copy link
Contributor

This PR is to address #28 . I'm inexperienced with shell scripts so be very skeptical of my PR! But I tried my best.

  1. I changed the single brackets to double brackets so it works with zsh.

  2. If the script detects that this is being sourced from zsh, we use ${(%):-%x} instead of $BASH_SOURCE (stolen from here: https://stackoverflow.com/a/28336473)

  3. I did some refactoring to remove some exit 1. This is because, when being sourced, this script would use to print the error message and then exit immediately so the user would have no idea what went wrong!

@williamstein
Copy link

@haraldschilly can you look at this -- I think you wrote enable.sh, since I don't remember it?

@kevinywlui
Copy link
Contributor Author

I did a rebase followed by a commit that removes the line from the README.md stating that zsh doesn't work

@vbraun
Copy link
Member

vbraun commented Jan 29, 2022

Sorry for overlooking this, but merge conflict!

@mkoeppe mkoeppe requested a review from dimpase April 6, 2022 19:07
Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

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

It looks way too complicated to me. Are there any adjustments to be done for zsh ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants