command

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailExec = errors.New("failed to execute command, please troubleshoot logs")

ErrFailExec is used as generic failure for command line interface as preserving the real error can be difficult with concurrent setup.

Functions

func GenerateMakefile

func GenerateMakefile(conf *config.Runtime, path string) error

GenerateMakefile writes a generated Makefile blindly (overwrites).

func Get

func Get(ctx context.Context, conf *config.Runtime, p *program.Lock) error

Get implements ProgramCommandFunc, therefore needs to be concurrent-safe. Before downloading, Get attempts to: - validate the existing installation - if it failed, redo symlink, then validate again - if it still fails, then attempt to download This is useful when a project is working on branches with different versions of a given program, ensuring that we only download when absolutely necessary.

func IterateLockfilePrograms

func IterateLockfilePrograms(ctx context.Context, conf *config.Runtime, names []string, fn ProgramCommandFunc) error

IterateLockfilePrograms is an iterator which spawns a goroutine for each selected programs. Any subcommand can leverage this by honoring ProgramCommandFunc.

func Purge

func Purge(ctx context.Context, conf *config.Runtime, all, dryRun bool) error

Purge deletes downloaded binaries. By default, it only deletes downloaded binaries which no longer mentioned by the lockfile. Passing `all` will ignore lockfile check and deletes all programs.

func Sync

func Sync(ctx context.Context, conf *config.Runtime, writeToStdout bool) error

Sync reads the configuration file (conf.Path) and generates the lockfile (conf.LockfilePath). By default, it overwrites the lockfile blindly. If `writeToStdout` is true, then it writes to STDOUT and lockfile will not be touched.

func UpdateIgnoreFile

func UpdateIgnoreFile(conf *config.Runtime, path string) error

UpdateIgnoreFile appends bindl ignore entries if none exist.

func Verify

func Verify(ctx context.Context, conf *config.Runtime, prog *program.Lock) error

Verify implements ProgramCommandFunc, therefore needs to be concurrent-safe It verifies existing if the exiting program is consistent with what is declared by the lockfile.

Types

type ProgramCommandFunc

type ProgramCommandFunc func(context.Context, *config.Runtime, *program.Lock) error

ProgramCommandFunc is a shorthand to command execution function signature, allowing the command to be run concurrently for each program.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL