github.com/Masterminds/glide@v0.13.4-0.20190710143844-b94b39d657d8/action/import_gpm.go (about)

     1  package action
     2  
     3  import (
     4  	"github.com/Masterminds/glide/gpm"
     5  	"github.com/Masterminds/glide/msg"
     6  )
     7  
     8  // ImportGPM imports a GPM file.
     9  func ImportGPM(dest string) {
    10  	base := "."
    11  	config := EnsureConfig()
    12  	if !gpm.Has(base) {
    13  		msg.Die("No GPM Godeps file found.")
    14  	}
    15  	deps, err := gpm.Parse(base)
    16  	if err != nil {
    17  		msg.Die("Failed to extract GPM Godeps file: %s", err)
    18  	}
    19  	appendImports(deps, config)
    20  	writeConfigToFileOrStdout(config, dest)
    21  }