git @ Cat's Eye Technologies The-Dipple / 9dcb6e1
Add script to create a default Mercurial repo config, if none yet. Cat's Eye Technologies 12 years ago
1 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 #!/usr/bin/env ruby
1
2 project = File.basename(Dir.pwd)
3 filename = ".hg/hgrc"
4 if File.exist? filename
5 puts "#{filename} exists:\n\n"
6 else
7 File.open(filename, 'w') do |f|
8 f.puts <<"EOF"
9 [paths]
10 default = https://catseye@bitbucket.org/catseye/#{project}
11 EOF
12 end
13 puts "created #{filename}:\n\n"
14 end
15 File.open(filename, 'r') do |f|
16 while line = f.gets
17 puts line
18 end
19 end