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

Installing on Mac OS X need to check for existence of /usr/local/bin #21

Open
gtfierro opened this issue Jul 11, 2017 · 3 comments
Open

Comments

@gtfierro
Copy link

gtfierro commented Jul 11, 2017

If user hasn't done anything with Homebrew before (or other package managers), then the usual curl get.bw2.io/agent | sh' install will fail because it assumes existence of /usr/local/bin`.

Fix: something like

#!/bin/sh
if [ ! -e /usr/local/bin ]; then
   mkdir -p /usr/local/bin
fi
@immesys
Copy link
Owner

immesys commented Jul 11, 2017

doesn't mkdir -p just work even if it exists?

@gtfierro
Copy link
Author

Yeah, I guess it would, but I thought it might give an error if it already existed and if you had set -ex on, then I thought I would save the trouble of trying to do directory detection

@immesys
Copy link
Owner

immesys commented Jul 12, 2017

-p means no error if it exists along with the parent thing.

michael@shadowfall:~$ mkdir -p /tmp
michael@shadowfall:~$ echo $?
0

I'll add the mkdir in the next release

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

No branches or pull requests

2 participants