Documentation
¶
Overview ¶
Package autobun provides utilities for managing and running bun (JavaScript runtime) subprocesses, including automatic download and installation.
Index ¶
- Constants
- func DownloadBun(ctx context.Context, le *logrus.Entry, stateDir, version string) (string, error)
- func EnsureBun(ctx context.Context, le *logrus.Entry, stateDir, version string) (string, error)
- func FindBunPath(stateDir, version string) (string, error)
- func GetBunArch() (string, error)
- func GetBunBinaryName() string
- func GetBunDownloadURL(version string) (string, error)
- func GetBunPlatform() (string, error)
- func GetLocalBunDir(stateDir string) string
- func GetLocalBunPath(stateDir, version string) string
- func RunBun(ctx context.Context, le *logrus.Entry, stateDir, version string, args []string) error
Constants ¶
const BunDownloadURLTemplate = "https://github.com/oven-sh/bun/releases/download/bun-v%s/bun-%s-%s.zip"
BunDownloadURLTemplate is the URL template for downloading bun releases. Format: https://github.com/oven-sh/bun/releases/download/bun-v{version}/bun-{platform}-{arch}.zip
const DefaultBunVersion = "1.3.4"
DefaultBunVersion is the default version of bun to download.
Variables ¶
This section is empty.
Functions ¶
func DownloadBun ¶
DownloadBun downloads the specified version of bun to the state directory.
func EnsureBun ¶
EnsureBun ensures bun is available, downloading it if necessary. Returns the path to the bun binary.
func FindBunPath ¶
FindBunPath finds the path to the bun binary. First checks if bun is in the system PATH, then checks the local installation.
func GetBunArch ¶
GetBunArch returns the bun architecture name for the current architecture.
func GetBunBinaryName ¶
func GetBunBinaryName() string
GetBunBinaryName returns the bun binary name for the current platform.
func GetBunDownloadURL ¶
GetBunDownloadURL returns the download URL for the specified bun version.
func GetBunPlatform ¶
GetBunPlatform returns the bun platform name for the current OS.
func GetLocalBunDir ¶
GetLocalBunDir returns the local directory where bun is downloaded.
func GetLocalBunPath ¶
GetLocalBunPath returns the path to the local bun binary.
Types ¶
This section is empty.