Created
October 26, 2018 23:58
-
-
Save alanhogan/87a95952cddfb0ebf6581f06cc6328bf to your computer and use it in GitHub Desktop.
Very good Ruby broh
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
#!/usr/bin/env ruby | |
require 'find' | |
puts "Deleting all .scss files !!!! !!11" | |
deleted = 0 | |
Find.find('.') do |path| | |
if FileTest.directory?(path) | |
if ['npm-packages-offline-cache', 'node_modules'].include? File.basename(path) | |
puts "Skipping #{File.basename(path)}" | |
Find.prune # Don't look any further into this directory. | |
else | |
next | |
end | |
elsif File.basename(path) =~ /\.scss$/ | |
puts "Removing #{path}" | |
File.delete(path) | |
deleted += 1 | |
end | |
end | |
puts "#{deleted} .scss files removed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment