shellpath

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 21 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 shellpath is what a user types in the shells of this computer: the command icebath and the shell commands of the profiles on the PATH of every shell they use, with the completions of icebath, looked at and put right from inside the program. And what an install script leaves the program to finish the first time it starts

Index

Constants

View Source
const (
	GroupIcebath     = "icebath"
	GroupShells      = "Shells"
	GroupProfiles    = "Profile commands"
	GroupCompletions = "Completions"
	GroupPrograms    = "Programs"
	GroupComputer    = "This computer"
)

Parts of the report, in the order it lists them

View Source
const UserPath = `HKEY_CURRENT_USER\Environment\Path`

UserPath is the Windows user PATH's registry value. Setup writes it like a file.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Group, Title string
	// What it is of, such as a file or a folder, as a user reads it
	Value string
	State State
	// More about it and what to do about it, whole sentences. Fix empty when nothing is to be done
	Detail, Fix string
	// Setting up puts it right
	Repairs bool
	// Name of the row, the same from one look to the next, which a finding of the doctor is keyed by
	Key string
	// Files lists every file the row's setup writes. UserPath means the Windows user PATH.
	Files []string
}

One thing the report says

type Line

type Line struct {
	Text  string
	State State
}

One thing setting up did or could not do, in the state it leaves

type Report

type Report struct {
	Items []Item
	// What the user does for the shell they are in, empty when it finds this icebath already
	Running string
	// What the first start after an install does now, empty when nothing
	Settling string
}

How the shells of this computer find icebath and the commands of the profiles

func (Report) Files

func (r Report) Files() []string

Files returns every file the setup writes for the repairable rows, each once.

func (Report) Repairable

func (r Report) Repairable() bool

Whether any row is wrong in a way setting up puts right

type ShellPath

type ShellPath struct {
	// contains filtered or unexported fields
}

The shells of the user as icebath sets them up, and what the first start after an install finishes

func New

func New(cfg *config.Config, pk *packages.Packages) *ShellPath

func (*ShellPath) Close

func (s *ShellPath) Close() error

Stops what the first start does, waiting for it. What it did not finish is owed again at the next start

func (*ShellPath) Folders

func (s *ShellPath) Folders() []string

Folders icebath puts on the user's PATH that are there: the folder of the command of this install, that of the profiles' commands, and those the lines icebath added to startup files name

func (*ShellPath) Report

func (s *ShellPath) Report(ctx context.Context) Report

How the shells of this computer find icebath, the commands of the profiles and the completions, read without changing anything

func (*ShellPath) SetUp

func (s *ShellPath) SetUp(ctx context.Context, files []string) ([]Line, string, error)

SetUp fixes what the report finds wrong: the icebath command in the command folder points to this program (on Windows, the program's folder comes first on the user PATH), every shell family's startup files that lack it get the marked PATH line, the profile command folder goes on PATH when there are profile commands, lines icebath added for a missing folder and commands of deleted profiles are removed, the completions are written, and the install stamp records what was added so an uninstall removes it. It returns each step, and the words for the user's current shell, or an error when there is no program to set up. It writes only the given files, which the report's rows list (Report.Files).

func (*ShellPath) Settling

func (s *ShellPath) Settling() string

What the first start after an install does now, empty when it does nothing

func (*ShellPath) Start

func (s *ShellPath) Start()

Start writes completions if Completions is on and drops the programs the install left out.

func (*ShellPath) Telling

func (s *ShellPath) Telling(tell func(profile, text string))

Names how the user is told what the first start after an install did, in the sessions of the profile in use

type State

type State string

How a row of the report stands

const (
	// Set up and working
	Good State = "good"
	// Works, or works in part, and something needs a look
	Warn State = "warn"
	// Does not work
	Bad State = "bad"
	// A fact worth knowing
	Note State = "note"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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