rares (owner)

Fork Of

Revisions

gist: 69917 Download_button fork
public
Public Clone URL: git://gist.github.com/69917.git
Embed All Files: show embed
ExampleCleanTarget.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
task :clean do
  important_cleans = `git clean -n -d`.split("\n")
  important_cleans.reject! { |file|
    file =~ /~$/ or
    file =~ /#/ or
    file =~ /.beam$/
  }
  if important_cleans.size > 0
    puts "Refusing to clean because:"
    puts important_cleans.join("\n")
  else
    sh "cd .. && git clean -x -d -f"
  end
end