-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Warn users with harmful path_helper calls
#423
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
Conversation
El Capitan moves the `path_helper` call to `zprofile`, but our dotfiles had already accounted for it being in `zshenv` where it was previously.
ef0f740 to
95da876
Compare
|
Correctly warned on my machine. |
|
The warning message is missing the word |
|
That's because I was so helpfully calling path_helper rather than displaying it. |
|
One more issue: if ❯ rcup
grep: /etc/zprofile: No such file or directory |
|
hm. I thought that's what |
hooks/post-up
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to man grep on OS X, --quiet and --silent do the same thing:
-q, --quiet, --silent
Quiet mode: suppress normal output. grep will only search a file until a match has been found, making searches potentially less expensive.
Do you mean --quiet --no-messages?
-s, --no-messages
Silent mode. Nonexistent and unreadable files are ignored (i.e. their error messages are suppressed).
Is there a difference between OS X, *BSD, and Linux grep here? @thoughtbot/shell
|
Updated. The flag I wanted was |
hooks/post-up
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this doesn't require the quotes. But it doesn't really matter.
|
I have no further input on the quality of this shell script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more portable way to write this is:
if grep path_helper /etc/zprofile >/dev/null 2>/dev/null; thenThat will work on unix systems in addition to GNU.
|
Looks like we're going in another direction. |
|
Hi @derekprior I wanted to wait until we resolved the issues in #426 before making a call here. |
|
In any event - the code there will be more useful in displaying a better message. |
El Capitan moves the
path_helpercall tozprofile, but our dotfileshad already accounted for it being in
zshenvwhere it was previously.