restart

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Launch

func Launch(req Request) error

Launch writes a self-deleting helper script to /tmp and starts it. The caller should then initiate its own graceful shutdown (e.g. set quitting=true and return tea.Quit).

The helper script waits for the current process (PID) to fully exit before launching the new one.

func ResolveBinary

func ResolveBinary() (string, error)

ResolveBinary returns the path to the ggcode binary that should be used for restart. It resolves symlinks so npm/python wrappers point to the latest installed version.

Types

type Request

type Request struct {
	// Binary is the path to the ggcode binary to launch.
	Binary string
	// Args are the CLI arguments for the new process (e.g. --resume, --config).
	Args []string
	// WorkDir is the working directory for the new process.
	WorkDir string
	// PID is the current process PID (the script waits for it to exit).
	PID int
}

Request contains all info needed to re-launch after exit.

Jump to

Keyboard shortcuts

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