scrub

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 6 Imported by: 1 module, 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 scrub provides the cleanup functionality for the development environment.

Index

Constants

This section is empty.

Variables

View Source
var ScrubCmd = &cobra.Command{
	Use:   "scrub",
	Short: "Deep cleans the development environment (Docker, Nix, Caches).",
	Long: `Performs a "Scorched Earth" cleanup of the development environment.
Targeting:
- Android Emulator & SDK artifacts (.emu, .androidsdkroot)
- Go build and module caches
- Docker system (prune all)
- Nix garbage (old generations)
- General user cache (~/.cache)

WARNING: This is destructive and will remove cached data to free up space.`,
	RunE: func(cmd *cobra.Command, _ []string) error {
		presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr())
		ctx := cmd.Context()

		presenter.Warning("INITIATING DEEP CLEANUP PROTOCOL")
		presenter.Warning("This will wipe Docker images, Go caches, and Nix garbage.")

		if !globals.AssumeYes {
			confirmed, err := presenter.PromptForConfirmation("Are you sure you want to proceed?")
			if err != nil || !confirmed {
				presenter.Info("Scrub aborted.")

				return nil
			}
		}

		cleanAndroid(ctx, presenter)

		cleanGo(ctx, presenter)

		cleanDocker(ctx, presenter)

		cleanNix(ctx, presenter)

		cleanUserCache(presenter)

		presenter.Header("--- Final Disk Usage ---")

		_ = globals.ExecClient.Execute(ctx, ".", "du", "-h", "--max-depth=1", ".")

		presenter.Success("Cleanup Complete. You are ready to build.")

		return nil
	},
}

ScrubCmd represents the scrub command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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