don't write gitignore if one exists already

This commit is contained in:
Jason Davis-Cooke
2015-06-29 08:50:13 -04:00
parent 0763265be1
commit 315d3d6499
2 changed files with 6 additions and 4 deletions

View File

@@ -47,9 +47,11 @@ module Zanzibar
## Make sure the directory exists and that a .gitignore is there to ignore it ## Make sure the directory exists and that a .gitignore is there to ignore it
if @settings['secret_dir'] if @settings['secret_dir']
FileUtils.mkdir_p(@settings['secret_dir']) FileUtils.mkdir_p(@settings['secret_dir'])
File.open("#{@settings['secret_dir']}/.gitignore", 'w') do |file| if !File.exist? "#{@settings['secret_dir']}/.gitignore"
file.puts '*' File.open("#{@settings['secret_dir']}/.gitignore", 'w') do |file|
file.puts '!.gitignore' file.puts '*'
file.puts '!.gitignore'
end
end end
end end
end end

View File

@@ -1,4 +1,4 @@
# The version of the gem # The version of the gem
module Zanzibar module Zanzibar
VERSION = '0.1.19' VERSION = '0.1.20'
end end