nuke

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package nuke provides discovery and deletion logic for the 'devx nuke' command. It detects project ecosystems, collects caches/build artifacts/devx resources, and presents a pre-flight manifest with disk sizes before performing any deletions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(b int64) string

FormatBytes formats a byte count as a human-readable string (exported for cmd use).

Types

type Item

type Item struct {
	Category    string // e.g. "Node.js", "Go", "devx"
	Label       string // human-readable name ("node_modules", "postgres container")
	Path        string // filesystem path, or empty for container/volume items
	SizeBytes   int64
	SizeDisplay string // pre-formatted (e.g. "1.2 GB", "container")
	Kind        string // "dir", "file", "container", "volume"
}

Item represents a single resource that will be deleted by devx nuke.

type Manifest

type Manifest struct {
	Items     []Item
	TotalSize int64
	Runtime   string // "podman" or "docker"
}

Manifest collects all items scheduled for deletion.

func Collect

func Collect(projectDir, runtime string) (*Manifest, error)

Collect scans the given project directory and the devx VM for everything that would be removed by nuke. It never deletes anything — only reads.

func (*Manifest) Execute

func (m *Manifest) Execute(progress func(item Item, err error))

Execute performs the actual deletion of all items in the manifest. Each deletion is reported via the progress callback.

Jump to

Keyboard shortcuts

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