LoginSignup
1
1

More than 5 years have passed since last update.

Goの開発環境マネージャーを書いてみた(今更感)

Posted at

virtualenv的な、nvm的な、goenv的な

install

$ git clone https://github.com/astronoka/glen.git ~/.glen

# PATHが通っているところにおく
$ ln -s ~/.glen/glen.sh ~/bin/glen

$ glen version
0.1.0

usage

$ glen help

Usage: glen <cmd>

Commands:

version                         Print glen version
help                            Output help text
install <version>               Install the version passed (ex: go1.4.2)
uninstall <version>             Delete the install for <version>
list                            List installed versions
available                       List available versions (tags)
env list                        List environments
env create <envname> <version>  Create environment
env delete <envname>            Delete environment
workon <envname>                Activate environment

sample

$ glen install go1.4.2
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio

...

test/syntax/typesw.go
test/syntax/vareq.go
test/syntax/vareq1.go

sent 177575895 bytes  received 110368 bytes  50767503.71 bytes/sec
total size is 177244465  speedup is 1.00
successfully installed: go1.4.2

$ glen list
go1.4.2

$ glen env create foo go1.4.2

$ glen env list
foo

$ glen env use foo

(foo:go1.4.2) $ type go
go is /Users/astronoka/.glen/installed/go1.4.2/bin/go

(foo:go1.4.2) $ echo $GOPATH
/Users/astronoka/.glen/env/foo

試した環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.5
BuildVersion:   13F1077

$ $SHELL --version
GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin13.4.0)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

やりたいこと

  • デフォルトのenv
  • oracleなどを自動get
  • 依存パッケージ管理
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1