initial-install.sh makes an error several times

Issue #11 resolved
Momiji Amedama created an issue

Hi, I am newbe in go/goenv. I tried to install goenv by initial-install.sh but the following error happened.

$ export GOENVGOROOT=$HOME/.goenvs
$ export GOENVTARGET=$HOME/bin
$ export GOENVHOME=$HOME/workspace
$ curl -L https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/initial-install.sh | zsh
[goenv] please confirm directory permission for GOENVGOROOT
$ curl -L https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/initial-install.sh | zsh
[goenv] please confirm directory permission for GOENVTARGET

That succeeded in the 3rd time finally.

$ curl -L https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/initial-install.sh | zsh
...(snip)...
Checking connectivity... done.
[goenv] install finished.

As long as I have examined, the following line is always true in my environment. https://bitbucket.org/ymotongpoo/goenv/src/af916f539acc4a339e71e106fcf6480dd790f696/shellscripts/initial-install.sh?at=develop&fileviewer=file-view-default#initial-install.sh-17 https://bitbucket.org/ymotongpoo/goenv/src/af916f539acc4a339e71e106fcf6480dd790f696/shellscripts/initial-install.sh?at=develop&fileviewer=file-view-default#initial-install.sh-24

IMHO, the above code may replaced to the following.

mkdir $GOENVGOROOT
if [ $? -ne 0 ]; then

Talking about mkdir command, I recommend to use -p option. If path is deep, mkdir does't create parent directories. (e.g. mkdir /foo/bar/baz/hoge/fuga/piyo)

My environment:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F27
$ zsh --version
zsh 5.0.5 (x86_64-apple-darwin14.0)

Comments (3)

  1. Momiji Amedama reporter

    This issue is partly fixed.

    Regarding the error of "confirm directory permission...", I'll report once again if details are understood.

  2. Log in to comment