github.com/jcarley/cli@v0.0.0-20180201210820-966d90434c30/commands/git/show.go (about)

     1  package git
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/Sirupsen/logrus"
     7  	"github.com/daticahealth/cli/commands/services"
     8  )
     9  
    10  func CmdShow(svcName string, is services.IServices) error {
    11  	service, err := is.RetrieveByLabel(svcName)
    12  	if err != nil {
    13  		return err
    14  	}
    15  	if service == nil {
    16  		return fmt.Errorf("Could not find a service with the label \"%s\". You can list services with the \"datica services list\" command.", svcName)
    17  	}
    18  	if service.Source == "" {
    19  		return fmt.Errorf("No git remote found for the \"%s\" service.", svcName)
    20  	}
    21  	logrus.Println(service.Source)
    22  	return nil
    23  }