Documentation
¶
Overview ¶
Package steps runs a definition's built-in install steps and writes its config files. Every path is resolved inside the server directory.
Index ¶
- Variables
- func Apply(d *spec.Definition, dir, goos string, opts Options) error
- func Resolve(dir, rel string) (string, error)
- func RunExec(ctx context.Context, d *spec.Definition, dir, goos string, tctx spec.Context, ...) error
- func WriteFiles(d *spec.Definition, dir string, ctx spec.Context) (written, pending []string, err error)
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrNotInstalled = errors.New("server files are missing; run `anyserve update` to reinstall them")
ErrNotInstalled means the server files aren't there.
Functions ¶
func Apply ¶
func Apply(d *spec.Definition, dir, goos string, opts Options) error
Apply runs the steps that apply to goos, in order.
func Resolve ¶
Resolve turns a definition's relative path into a host path inside dir, refusing anything that would escape it (including through symlinks).
func RunExec ¶
func RunExec(ctx context.Context, d *spec.Definition, dir, goos string, tctx spec.Context, out io.Writer) error
RunExec runs the definition's exec steps that apply to goos: each runs the server's own command once, from the server folder with HOME set to it, unless its creates path already exists.
func WriteFiles ¶
func WriteFiles(d *spec.Definition, dir string, ctx spec.Context) (written, pending []string, err error)
WriteFiles writes the definition's config files. Templated files without overwrite are only written when missing, so hand edits survive. Files with set have just those values changed every time; if such a file doesn't exist yet (many games create theirs on first start) and has no template, it is listed in pending and tried again on the next start.