Created
July 20, 2012 11:41
-
-
Save coffeeaddict/3150295 to your computer and use it in GitHub Desktop.
For philipp
This file contains hidden or 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
require 'find' | |
require 'term/ansicolor' | |
class Color | |
extend Term::ANSIColor | |
end | |
root = ARGV[0] || Dir.pwd | |
Find.find(root) do |path| | |
p_path = path.sub(root, '') | |
depth = File.dirname(p_path).split(/\//).count | |
p_path =(" " * depth) + File.basename(p_path) | |
puts File.directory?(path) ? Color.green(p_path) : Color.clear(p_path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment