Skip to content

Instantly share code, notes, and snippets.

@coffeeaddict
Created July 20, 2012 11:41
Show Gist options
  • Save coffeeaddict/3150295 to your computer and use it in GitHub Desktop.
Save coffeeaddict/3150295 to your computer and use it in GitHub Desktop.
For philipp
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