selfpath

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package selfpath resolves the path Stormlight re-invokes itself by.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve() (string, error)

Resolve returns a path to the running executable that will still start Stormlight after an upgrade.

os.Executable answers with the real file behind the process, which for a packaged install is version-stamped — Homebrew's cask resolves `bin/stormlight` to `Caskroom/stormlight/0.6.3/stormlight`. Stormlight hands that path to provider hooks as $STORMLIGHT_BIN, and both outlive the process that computed them: the next upgrade deletes the binary out from under every agent still running, and their hooks start failing with "No such file or directory".

The launcher on PATH is the stable name for the same program, so prefer it — but only once it is confirmed to be the same file. A development build run out of a worktree must keep its own path even though an installed `stormlight` shadows it on PATH, or end-to-end runs would silently exercise the installed binary instead of the one under test.

Once the running binary has actually been deleted that preference has nothing left to protect, and the identity check cannot run at all — there is no file to compare a candidate against. Rather than hand back a path that starts nothing, fall back to whatever PATH offers under the same name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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