tools

package
v0.0.0-...-2d6395d Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OS   = runtime.GOOS
	Arch = runtime.GOARCH
)

public vars to allow override in the tests

Functions

func MessageBox

func MessageBox(title, text string) int

MessageBox will open a dialog

func TellCommandNotToSpawnShell

func TellCommandNotToSpawnShell(_ *exec.Cmd)

TellCommandNotToSpawnShell will now spawn a shell

Types

type Tools

type Tools struct {
	// contains filtered or unexported fields
}

Tools will represent the installed tools

func New

func New(directory *paths.Path, index *index.Resource, logger func(msg string)) *Tools

New will return a Tool object, allowing the caller to execute operations on it. The New functions accept the directory to use to host the tools, an index (used to download the tools), and a logger to log the operations

func (*Tools) Download

func (t *Tools) Download(pack, name, version, behaviour string) error

Download will parse the index at the indexURL for the tool to download. It will extract it in a folder in .arduino-create, and it will update the Installed map.

pack contains the packager of the tool name contains the name of the tool. version contains the version of the tool. behaviour contains the strategy to use when there is already a tool installed

If version is "latest" it will always download the latest version (regardless of the value of behaviour)

If version is not "latest" and behaviour is "replace", it will download the version again. If instead behaviour is "keep" it will not download the version if it already exists.

func (*Tools) GetLocation

func (t *Tools) GetLocation(command string) (string, error)

GetLocation extracts the toolname from a command like

Jump to

Keyboard shortcuts

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