$GOPATHå ã®ãªãã¸ããªã楽ã«ç§»åãã
å¿ è¦ãªãã®
ãããªæã
$ cat ~/.zshrc | grep anything-gorepo alias gogo='cd $(anything-gorepo)'
#!/usr/bin/env ruby # anything-gorepo unless ENV['GOPATH'] STDERR.puts '$GOPATH should not be empty' exit 1 end require 'ruby-anything' def directories path Dir.entries(path).select do |filename| File.directory?(File.join(path, filename)) end.select do |filename| filename != '.' && filename != '..' end end gosrc = File.expand_path("#{ENV['GOPATH'].dup}/src") repo_paths = [] directories(gosrc).each do |host| directories(File.join(gosrc, host)).each do |user| directories(File.join(gosrc, host, user)).each do |repo| repo_paths << File.join(host, user, repo) # diplay without gopath end end end STDOUT.puts File.join(gosrc, _anything_(repo_paths))
anything-gorepoã¯é©å½ãªååã§gemåããããç¥ããªãã
追è¨
anything-gorepoã¯gemã«ããã