github.com/andrewlunde/glide@v0.20.1/action/import_gom.go (about)

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