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

fix: shellcheck errors #3082

Merged
merged 1 commit into from
Apr 11, 2023
Merged

fix: shellcheck errors #3082

merged 1 commit into from
Apr 11, 2023

Conversation

dijonkitchen
Copy link
Contributor

Resolves #3081

README.md Outdated
@@ -599,8 +599,9 @@ cdnvm() {
fi
fi
}

cdnvm "$PWD" || exit
Copy link
Member

Choose a reason for hiding this comment

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

is the intention here that if cdnvm fails, the alias should not be set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this was meant to address https://www.shellcheck.net/wiki/SC2164, but I think it's surprising with the reordering which was meant to keep the cdnvm code together and the alias after and separate since shellcheck advised against using an alias in the same parsing unit: https://www.shellcheck.net/wiki/SC2262

To adhere more to the principle of least surprise, I'm going to reorder it back and still have the exit:

# ...
alias cd='cdnvm'
cdnvm "$PWD" || exit
# ...

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

Successfully merging this pull request may close these issues.

2 participants