autobun

package
v1.33.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package autobun provides utilities for managing and running bun (JavaScript runtime) subprocesses, including automatic download and installation.

Index

Constants

View Source
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

View Source
const DefaultBunVersion = "1.3.4"

DefaultBunVersion is the default version of bun to download.

Variables

This section is empty.

Functions

func DownloadBun

func DownloadBun(ctx context.Context, le *logrus.Entry, stateDir, version string) (string, error)

DownloadBun downloads the specified version of bun to the state directory.

func EnsureBun

func EnsureBun(ctx context.Context, le *logrus.Entry, stateDir, version string) (string, error)

EnsureBun ensures bun is available, downloading it if necessary. Returns the path to the bun binary.

func FindBunPath

func FindBunPath(stateDir, version string) (string, error)

FindBunPath finds the path to the bun binary. First checks if bun is in the system PATH, then checks the local installation.

func GetBunArch

func GetBunArch() (string, error)

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

func GetBunDownloadURL(version string) (string, error)

GetBunDownloadURL returns the download URL for the specified bun version.

func GetBunPlatform

func GetBunPlatform() (string, error)

GetBunPlatform returns the bun platform name for the current OS.

func GetLocalBunDir

func GetLocalBunDir(stateDir string) string

GetLocalBunDir returns the local directory where bun is downloaded.

func GetLocalBunPath

func GetLocalBunPath(stateDir, version string) string

GetLocalBunPath returns the path to the local bun binary.

func RunBun

func RunBun(ctx context.Context, le *logrus.Entry, stateDir, version string, args []string) error

RunBun runs bun with the given arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

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