Sha256: 179df4135abb570ce340528977aad38b6c89e2e8ac8e17148c6dfc96b7efcef1

Contents?: true

Size: 588 Bytes

Versions: 4

Compression:

Stored size: 588 Bytes

Contents

require "fileutils"

class Lono::CLI
  class Clean
    include Lono::Utils::Logging
    include Lono::Utils::Sure

    attr_reader :options
    def initialize(options={})
      @options = options
      @mute = options[:mute] # used by CLI::Build at beginning to clear out the output folder
    end

    def run
      folders = %w[output tmp]
      @mute || sure?("Will remove folders: #{folders.join(' ')}")
      folders.each do |folder|
        FileUtils.rm_rf("#{Lono.root}/#{folder}")
      end
      logger.info "Removed folders: #{folders.join(' ')}" unless @mute
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc6 lib/lono/cli/clean.rb
lono-8.0.0.pre.rc5 lib/lono/cli/clean.rb
lono-8.0.0.pre.rc4 lib/lono/cli/clean.rb
lono-8.0.0.pre.rc3 lib/lono/cli/clean.rb