-
-
Save rares/69917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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