Class: Bridgetown::Commands::Clean

Inherits:
Thor::Group
  • Object
show all
Extended by:
BuildOptions, Summarizable
Includes:
ConfigurationOverridable
Defined in:
lib/bridgetown-core/commands/clean.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BuildOptions

extended

Methods included from Summarizable

summary

Methods included from ConfigurationOverridable

#configuration_with_overrides, included

Class Method Details



14
15
16
# File 'lib/bridgetown-core/commands/clean.rb', line 14

def self.banner
  "bridgetown clean [options]"
end

Instance Method Details

#cleanObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bridgetown-core/commands/clean.rb', line 19

def clean
  config = configuration_with_overrides(options, Bridgetown::Current.preloaded_configuration)
  destination = config["destination"]
   = File.join(config["root_dir"], ".bridgetown-metadata")
  cache_dir = File.join(config["root_dir"], config["cache_dir"])
  bundling_dir = File.join(config["root_dir"], ".bridgetown-cache", "frontend-bundling")

  remove(destination, checker_func: :directory?)
  remove(, checker_func: :file?)
  remove(cache_dir, checker_func: :directory?)
  remove(bundling_dir, checker_func: :directory?)
end