github.com/matthewbelisle-wf/godep@v0.0.0-20140716191328-dba190f14fc8/path.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  var cmdPath = &Command{
     8  	Usage: "path",
     9  	Short: "print sandbox path for use in a GOPATH",
    10  	Long: `
    11  Path ensures a sandbox is prepared for the dependencies
    12  in file Godeps. It prints a path for use in a GOPATH
    13  that makes available the specified version of each dependency.
    14  
    15  The printed path does not include any GOPATH value from
    16  the environment.
    17  
    18  For more about how GOPATH works, see 'go help gopath'.
    19  `,
    20  	Run: runPath,
    21  }
    22  
    23  // Set up a sandbox and print the resulting gopath.
    24  func runPath(cmd *Command, args []string) {
    25  	if len(args) != 0 {
    26  		cmd.UsageExit()
    27  	}
    28  	gopath := prepareGopath()
    29  	fmt.Println(gopath)
    30  }