Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created February 24, 2009 23:09
Show Gist options
  • Save KirinDave/69856 to your computer and use it in GitHub Desktop.
Save KirinDave/69856 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment