Class: Everywhere::Commands::Clean
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Everywhere::Commands::Clean
- Defined in:
- lib/everywhere/commands/clean.rb
Overview
Wipes the shared cargo build cache under ~/.rubyeverywhere (or
$RUBYEVERYWHERE_HOME). Safe to run any time: only compiled shell output
lives there, so the next every dev/every build just recompiles cold.
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/everywhere/commands/clean.rb', line 14 def call(**) target = Everywhere::Paths.cargo_target_dir return UI.step("nothing to clean #{UI.dim("(#{target} doesn't exist)")}") unless File.exist?(target) size = human_size(dir_bytes(target)) FileUtils.rm_rf(target) UI.success("removed #{target} (#{size} freed) — the next build recompiles the shell cold") end |