Skip to content

Conversation

@derekprior
Copy link
Contributor

El Capitan moves the path_helper call to zprofile, but our dotfiles
had already accounted for it being in zshenv where it was previously.

El Capitan moves the `path_helper` call to `zprofile`, but our dotfiles
had already accounted for it being in `zshenv` where it was previously.
@geoffharcourt
Copy link
Collaborator

Correctly warned on my machine.

@geoffharcourt
Copy link
Collaborator

The warning message is missing the word path_helper on my screen output. Are the backticks trying to execute path_helper there?

@derekprior
Copy link
Contributor Author

That's because I was so helpfully calling path_helper rather than displaying it.

@geoffharcourt
Copy link
Collaborator

One more issue: if zprofile doesn't exist, there's an error message:

❯ rcup
grep: /etc/zprofile: No such file or directory

@derekprior
Copy link
Contributor Author

hm. I thought that's what --silet was supposed to fix.

hooks/post-up Outdated
Copy link
Contributor

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

@derekprior
Copy link
Contributor Author

Updated. The flag I wanted was --no-messages

hooks/post-up Outdated
Copy link
Contributor

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.

@gabebw
Copy link
Contributor

gabebw commented Oct 2, 2015

I have no further input on the quality of this shell script.

Copy link
Contributor

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; then

That will work on unix systems in addition to GNU.

@derekprior
Copy link
Contributor Author

Looks like we're going in another direction.

@derekprior derekprior closed this Oct 16, 2015
@derekprior derekprior deleted the dp-el-cap-warning branch October 16, 2015 19:16
@geoffharcourt
Copy link
Collaborator

Hi @derekprior I wanted to wait until we resolved the issues in #426 before making a call here.

@derekprior
Copy link
Contributor Author

In any event - the code there will be more useful in displaying a better message.

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.

5 participants