github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/cli/commands/resources/repository/pull.go (about)

     1  package repositoryCommands
     2  
     3  import (
     4  	"github.com/taubyte/tau-cli/cli/common"
     5  	"github.com/urfave/cli/v2"
     6  )
     7  
     8  func (lib *repositoryCommands) PullCmd() common.Command {
     9  	return common.Create(
    10  		&cli.Command{
    11  			Action: lib.Pull,
    12  		},
    13  	)
    14  }
    15  
    16  func (lib *repositoryCommands) Pull(ctx *cli.Context) error {
    17  	project, resource, info, err := lib.selectResource(ctx)
    18  	if err != nil {
    19  		return err
    20  	}
    21  
    22  	_, err = info.Pull(project, resource.Get().RepositoryURL())
    23  	if err != nil {
    24  		return err
    25  	}
    26  	lib.I18nPulled(resource.Get().RepositoryURL())
    27  
    28  	return nil
    29  }