Skip to content

Commit

Permalink
Remove files manually instead of using Thor's remove_dir method.
Browse files Browse the repository at this point in the history
We're going to pull this out into a separate class, so the clean
functionality shouldn't depend on Thor.
This also makes `rakep clean` quiet unless you're `--pretend`ing.
  • Loading branch information
dudleyf committed Jan 15, 2012
1 parent 35a92f2 commit 1c99f79
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/rake-pipeline/runner.rb
Expand Up @@ -7,8 +7,6 @@ class Pipeline
# changes.
#
class Runner < Thor
include Thor::Actions

# @return [Pipeline] the pipeline this Runner is controlling.
attr_reader :pipeline

Expand Down Expand Up @@ -42,7 +40,11 @@ def build
method_option :pretend, :type => :boolean, :aliases => "-p"
def clean
pipeline.setup_filters
files_to_clobber.each { |dir| remove_dir dir }
if options["pretend"]
files_to_clobber.each { |dir| say_status(:remove, relative_path(dir)) }
else
files_to_clobber.each { |dir| FileUtils.rm_rf(dir) }
end
end

desc "server", "Run the Rake::Pipeline preview server."
Expand Down Expand Up @@ -80,7 +82,7 @@ def initialize(*)
# @return [void]
def cleanup_tmpdir
pipeline.setup_filters
obsolete_tmpdirs.each { |dir| remove_dir dir }
obsolete_tmpdirs.each { |dir| FileUtils.rm_rf(dir) }
end

# Invoke the pipeline, detecting any changes to the Assetfile
Expand Down

0 comments on commit 1c99f79

Please sign in to comment.