class Texico::CLI::Command::Clean

Private Class Methods

match?(command) click to toggle source
# File lib/texico/cli/command/clean.rb, line 27
def match?(command)
  command == 'clean'
end

Public Instance Methods

run() click to toggle source
# File lib/texico/cli/command/clean.rb, line 7
def run
  config = load_config
  build_dir = config[:build]
  
  if remove(build_dir) || remove(Build::SHADOW_BUILD_DIR)
    prompt.say "#{ICON} Removing old build files", color: :bold
  else
    prompt.say "#{ICON} Everything is already clean", color: :bold
    return
  end
end

Private Instance Methods

remove(dir) click to toggle source
# File lib/texico/cli/command/clean.rb, line 21
def remove(dir)
  return false unless File.exist? dir
  FileUtils.rm_r dir unless opts[:dry_run]
end