Skip to content

Commit

Permalink
create gitconfig on systems that do not have it
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Jul 22, 2014
1 parent 271fae2 commit 011aefd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion install.rb
Expand Up @@ -31,7 +31,8 @@ def move_file_to_backup(original, backup)

def add_include_to_gitconfig(dotfiles)
gitconfig = ".gitconfig"
if File.exist?(gitconfig) && !File.read(gitconfig).include?("[include]")
File.write(gitconfig, "") unless File.exist?(gitconfig)
if !File.read(gitconfig).include?("[include]")
File.open(gitconfig, "a+") { |f| f.write "\n\n[include]\n path=#{dotfiles}/gitconfig\n" }
end
end
Expand Down

0 comments on commit 011aefd

Please sign in to comment.