Class: Ocak::Commands::Clean
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Ocak::Commands::Clean
- Defined in:
- lib/ocak/commands/clean.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ocak/commands/clean.rb', line 11 def call(**) config = Config.load manager = WorktreeManager.new(config: config) puts 'Cleaning stale worktrees...' removed = manager.clean_stale if removed.empty? puts 'No stale worktrees found.' else removed.each { |path| puts " Removed: #{path}" } puts "Cleaned #{removed.size} worktree(s)." end rescue Config::ConfigNotFound => e warn "Error: #{e.}" exit 1 end |