lib/gitolite/config.rb in gitolite-rugged-1.2.pre.devel vs lib/gitolite/config.rb in gitolite-rugged-1.2.1.pre.devel

- old
+ new

@@ -1,6 +1,7 @@ require 'tempfile' +require 'fileutils' module Gitolite class Config @@ -71,11 +72,11 @@ @groups[name] end def to_file(path=".", filename=@filename) - raise ArgumentError, "Path contains a filename or does not exist" unless File.directory?(path) + FileUtils.mkdir_p(path) unless File.directory?(path) new_conf = File.join(path, filename) File.open(new_conf, "w") do |f| f.sync = true @@ -116,9 +117,12 @@ end def process_config(config) context = [] #will store our context for permissions or config declarations + + # On first call with a custom *.conf, the config might not yet exist + return unless File.exists?(config) #Read each line of our config File.open(config, 'r').each do |l| line = cleanup_config_line(l)