Home > Uncategorized > One-liner in Ruby to add empty .gitignore to empty directories

One-liner in Ruby to add empty .gitignore to empty directories

ruby -e 'require "fileutils" ; Dir.glob(["**","**/**"]).each { |f| FileUtils.touch(File.join(f, ".gitignore")) if File.directory?(f) }'

I suggest you stick this in a Rakefile for your project.

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.