Skip to main content

Module channel

Module channel 

Source
Expand description

Which package manager delivered the binary that is running, and what that implies.

Every lifecycle command needs this answer and each one used to work it out for itself. update had a private Channel enum, uninstall had a substring match returning an uninstall command, and doctor had a hand-written list of directories to search. Three classifiers, three sets of markers, and only one of them had ever heard of WinGet — so devp update --install overwrote a file WinGet owns, devp uninstall offered to delete it, and devp doctor never looked there at all.

This module is the one answer. A channel knows its own name, its upgrade and uninstall commands, whether it owns the files it installed, and — the distinction that matters most — whether it replaces its whole directory on upgrade.

The markers are path fragments rather than probes on purpose: classification happens on the startup path of every lifecycle command, so it must not spawn a process, touch the network, or depend on a manager being installed to recognise what it installed.

Enums§

Channel
The package manager that owns the running binary.

Functions§

install_dirs
Every fixed directory a channel installs into, whether or not it is on PATH.