executable

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBuildEnv = BuildEnv{
	CGOEnabled: "0",
	GOOS:       "linux",
	GOARCH:     "amd64",
}
View Source
var DefaultVersionCommands = [][]string{
	{"-v"}, {"--v"}, {"version"}, {"-version"}, {"--version"},
}

DefaultVersionCommands is a predefined list of common flags and subcommands

View Source
var PackageFS embed.FS
View Source
var SrcDirPath string

Functions

func BuildBinary

func BuildBinary(mainFilePath string, targetBinaryPath string, moduleName string) error

func CheckDependencyExists

func CheckDependencyExists(name string) (string, bool)

func CheckVersionCompatibility

func CheckVersionCompatibility(foundVersion, declaredVersion string) (bool, string)

CheckVersionCompatibility determines if a found version satisfies version constraints

func ExtractSemver

func ExtractSemver(output string) (string, error)

ExtractSemver parses and validates a semantic version string (e.g., 1.2.3) from command output.

func GetAppDataDir

func GetAppDataDir(appName string) string

func GetDestDir

func GetDestDir() (string, error)

func GetPackageSrcDirPath

func GetPackageSrcDirPath() string

func GetVersion

func GetVersion(binaryPath string, customCommand []string) (string, error)

GetVersion retrieves the version of a binary using a user-specified command or falls back to defaults

func GetVersionWithFallbacks

func GetVersionWithFallbacks(binaryPath string) (string, error)

GetVersionWithFallbacks attempts to retrieve a version using common flags and subcommands

func RunCommand

func RunCommand(binaryPath string, args []string) (string, error)

RunCommand executes a command with the given arguments and returns its output

Types

type BuildEnv

type BuildEnv struct {
	CGOEnabled string
	GOOS       string
	GOARCH     string
}

BuildEnv holds build environment configuration

Jump to

Keyboard shortcuts

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