github.com/Racer159/jackal@v0.32.7-0.20240401174413-0bd2339e4f2e/src/pkg/packager/pull.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // SPDX-FileCopyrightText: 2021-Present The Jackal Authors
     3  
     4  // Package packager contains functions for interacting with, managing and deploying Jackal packages.
     5  package packager
     6  
     7  import (
     8  	"fmt"
     9  )
    10  
    11  // Pull pulls a Jackal package and saves it as a compressed tarball.
    12  func (p *Packager) Pull() (err error) {
    13  	if p.cfg.PkgOpts.OptionalComponents != "" {
    14  		return fmt.Errorf("pull does not support optional components")
    15  	}
    16  
    17  	_, err = p.source.Collect(p.cfg.PullOpts.OutputDirectory)
    18  	if err != nil {
    19  		return err
    20  	}
    21  
    22  	return nil
    23  }