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

goenv install flags (--list) #5

Open
sighmin opened this issue Feb 21, 2014 · 3 comments
Open

goenv install flags (--list) #5

sighmin opened this issue Feb 21, 2014 · 3 comments

Comments

@sighmin
Copy link

sighmin commented Feb 21, 2014

Thanks for getting this started dude.

It would be great to have a --list flag for the goenv install command o see what versions are available.

@simeonwillbanks
Copy link

@sighmin Cool idea. 😄

@wfarr Here are a couple potential implementations:

  1. Open Go Downloads page in a browser
    • open https://code.google.com/p/go/downloads/list
    • Super simple but cumbersome
  2. Add and maintain a list of available binaries

Thoughts? Thanks!

@simeonwillbanks
Copy link

@wfarr I thought of a third option; it doesn't require extra files.

3. Add and maintain an array of available binaries

  • In libexec/goenv-install, set array using platform, arch, and extra
  • No need for full definition files since we aren't compiling

Potential array implementation:

bash-3.2$ echo $platform
darwin
bash-3.2$ echo $arch
amd64
bash-3.2$ echo $extra
-osx10.8
bash-3.2$ VERSIONS["darwin_amd64_osx108"]="1.2.1 1.2"
bash-3.2$ VERSIONS["darwin_amd64_osx106"]="1.2.1 1.2"
bash-3.2$ key="${platform}_${arch}_$(echo ${extra} | tr -d '[:punct:]')"
bash-3.2$ echo $key
darwin_amd64_osx108
bash-3.2$ echo ${VERSIONS[$key]}
1.2.1 1.2
bash-3.2$ for version in `echo ${VERSIONS[$key]}`
> do
> echo $version
> done
1.2.1
1.2

Thanks for considering!

@sighmin
Copy link
Author

sighmin commented Mar 8, 2014

How's this? #6

I went with the third version. Sorry if it's not leet I'm not a bash expert.

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