github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/site-cookbooks/garden/recipes/dev.rb (about)

     1  file "/etc/profile.d/gopath.sh" do
     2    content <<-EOF
     3  export GOPATH=/go
     4  export PATH=/go/bin:$PATH
     5  
     6  function goto {
     7    local p
     8    local f
     9  
    10    for p in `echo $GOPATH | tr ':' '\n'`; do
    11      f=`find ${p}/src -maxdepth 3 -type d | grep ${1} | head -n 1`
    12      if [ -n "$f" ]; then
    13        cd $f
    14        return
    15      fi
    16    done
    17  }
    18  
    19  export GARDEN_TEST_ROOTFS=/opt/warden/rootfs
    20  EOF
    21  end