immesys / bw2

BOSSWAVE 2 Development
GNU General Public License v3.0
19 stars 9 forks source link

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

Open gtfierro opened 7 years ago

gtfierro commented 7 years ago

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 commented 7 years ago

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

gtfierro commented 7 years ago

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 commented 7 years ago

-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