intercept

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disable

func Disable() error

Disable removes shim symlinks and the PATH entry from shell profiles.

func Enable

func Enable() error

Enable writes shim symlinks for all managers and patches shell profiles.

func EnsureShims

func EnsureShims() error

EnsureShims rewrites shims to point at the current executable. Called automatically during `devscan update` to keep shims current.

func IsShimName

func IsShimName(name string) bool

IsShimName reports whether name matches a binary managed by any known manager.

func PrintBlocked

func PrintBlocked(manager string, pkgs []BlockedPackage)

PrintBlocked writes a high-visibility blocked-install warning to stderr. It is intentionally loud — it must stand out from surrounding npm/pip output.

func RunShim

func RunShim(name string, args []string)

RunShim is called when the devscan binary is invoked as a shim (argv[0] is a package manager name). It checks packages against the blocklist and either blocks or execs the real binary.

func ShimsDir

func ShimsDir() (string, error)

ShimsDir returns ~/.devscan/shims.

Types

type BlockedPackage

type BlockedPackage struct {
	Name    string
	Version string
	Reason  string
	Sources []string
}

BlockedPackage holds one match to display in the blocked output.

type ShimStatus

type ShimStatus struct {
	Binary  string
	Manager string
	Active  bool
	Path    string
}

func Status

func Status() ([]ShimStatus, error)

Status returns which shims are currently active.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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