Skip to content

Instantly share code, notes, and snippets.

@knu
Created June 12, 2009 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knu/128468 to your computer and use it in GitHub Desktop.
Save knu/128468 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
File.open('.bzrignore') { |bzrignore|
bzrignore.each_line { |line|
case line
when /^\#/, /^\s*$/
next
else
line.strip!
dir, pattern = File.split(line)
if File.directory?(dir)
File.open(File.join(dir, '.gitignore'), 'a') { |gitignore|
gitignore.puts pattern
}
end
end
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment