cli

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the crofty CLI version and the single source the rest of the code reads. Releases inject the git tag at build time: wharfy builds with -ldflags "-X main.version=…", and main() copies that into Version (see main.go). Plain `go build` from source leaves it as "dev".

Functions

func Run

func Run(args []string) int

Run dispatches a subcommand and returns a process exit code. It funnels every path through dispatch() so a single trailing update nudge covers them all (version, help, discover and each command alike).

Types

type Deployer

type Deployer interface {
	// Deploy uploads everything under distDir to the destination. progress
	// receives short human-readable lines so the caller can print them. It
	// returns the site's live URL when the provider knows it ("" when it can't —
	// e.g. an SFTP/FTPS host whose public URL depends on the owner's domain).
	Deploy(distDir string, progress func(string)) (url string, err error)
}

A Deployer publishes a built dist/ to one destination. Each deploy provider (Cloudflare Pages, SFTP, FTPS) implements it, so deploy.go can dispatch on the configured provider without knowing the wire details. The build and output- contract steps run once, before any Deployer is constructed — a Deployer only uploads an already-verified dist/.

Jump to

Keyboard shortcuts

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