utils

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

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// InitializeFlag will indicate if this is the first run of Sledgehammer
	InitializeFlag = "initialized"
)

Functions

func ContainerPath

func ContainerPath(path string) string

func DecorateExecutable

func DecorateExecutable(name string) string

func ExecutableName

func ExecutableName() (string, error)

ExecutableName will get the current name of the executable.

func ExecutablePath

func ExecutablePath() (string, error)

ExecutablePath will get the current path of the executable. Useful for creating symlinks, as symlinks are only created in the same directory as the slh executable

func Exists

func Exists(name string) (bool, error)

Exists will check if the given path exists

func GetRegistryAndTool

func GetRegistryAndTool(tool string) (string, string)

GetRegistryAndTool will return the registry and the tool name in separat variables if possible

func ImportPath

func ImportPath(path string) string

func IsPipe

func IsPipe() bool

IsPipe will determine if sledgehammer was called as part of a pipe or standalone

func PrepareEnvironment

func PrepareEnvironment(envs []string) []string

PrepareEnvironment will prepare the local environment variables for the use in the container

func PrepareMounts

func PrepareMounts(mos []string) []docker.HostMount

PrepareMounts will prepare all mounts that should be used in the container

func RandomString

func RandomString(length int) string

RandomString will generate a random string of a given length

func ShouldInitialize

func ShouldInitialize(cfg *config.Config) (bool, error)

ShouldInitialize will return if this is the first run of the tool

func WorkingDirectory

func WorkingDirectory(mounts []string) (string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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