public
Description: probably a waste of time
Clone URL: git://github.com/claude/git_local.git
Search Repo:
handling the config properly for new and upgrading users
claude (author)
Sat May 03 05:51:04 -0700 2008
commit  8249f1213e9670c784ab942a590a9406d9db67eb
tree    802800187db64165df62922315f436c15cf8b92a
parent  7f0c2233a3d246653e0527354abb3b8606cd20fb
...
104
105
106
107
 
108
109
110
...
104
105
106
 
107
108
109
110
0
@@ -104,7 +104,7 @@ helpers do
0
 
0
   def create_repositories_path(path, username)
0
     load_config
0
- Dir.mkdir(path)
0
+ Dir.mkdir(path) unless Dir.new(path)
0
     @config_to_create = { 'path' => path, 'username' => username }
0
     config_to_write
0
     File.open('config/config.yml', 'w') do |w|
...
5
6
7
 
8
9
 
 
10
11
12
13
14
15
 
 
 
 
 
 
 
 
 
16
 
17
18
19
20
21
22
23
 
 
 
24
25
26
...
39
40
41
42
43
 
 
44
...
5
6
7
8
9
 
10
11
12
 
13
14
15
 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
30
31
 
32
33
34
35
36
37
...
50
51
52
 
53
54
55
56
0
@@ -5,22 +5,33 @@
0
 
0
 - if @config == {}
0
 %form{:action => '/create_repo_path', :method => 'post'}
0
+ %h2 Set Up Your Server
0
   %p
0
- %label{:for => 'path'} Create a path for your repository: (/var/my_cool_new_git_repository)
0
+ %label{:for => 'path'} Create a path for your repository:
0
+ %i ie: /Users/your_username/git
0
     %input#path{:type => 'text', :name => 'path'}
0
- %br
0
     %label{:for => 'username'} Your ssh username for this machine
0
     %input#username{:type => 'text', :name => 'username'}
0
     %input{:type => 'submit', :value => 'Create'}
0
--end
0
+-end
0
+- unless @config['username'] || @config == {}
0
+%form{:action => '/create_repo_path', :method => 'post'}
0
+ %p
0
+ %label{:for => 'username'} Enter your ssh username for this machine
0
+ %input#username{:type => 'text', :name => 'username'}
0
+ %input#path{:type => 'hidden', :name => 'path', :value => "#{@config['path']}"}
0
+ %input{:type => 'submit', :value => 'Create'}
0
+- end
0
 
0
+- unless @config == {}
0
 %form{:action => '/add_repo', :method => 'post'}
0
   %p
0
     %label{:for => 'name'}Create a new project:
0
- %br
0
     %input#name{:type => 'text', :name => 'name'}
0
     %input{:type => 'submit', :value => 'Create'}
0
-
0
+- end
0
+
0
+-if @all_repos
0
 %div#admin_repos
0
   %h2 Your Projects:
0
   %ul
0
@@ -39,4 +50,5 @@
0
               - text = "[code lang='default']git push local +branch+[/code]"
0
               #push_text~ Syntaxi.new(text).process
0
               where +branch+ is the branch you're pushing to
0
- %i ie: master
0
\ No newline at end of file
0
+ %i ie: master
0
+-end
0
\ No newline at end of file
...
18
19
20
21
 
22
23
24
...
33
34
35
 
 
 
36
37
38
...
18
19
20
 
21
22
23
24
...
33
34
35
36
37
38
39
40
41
0
@@ -18,7 +18,7 @@ body
0
   :background-color = !color3
0
   :color = !color1
0
 
0
-h1
0
+h1, h2
0
   :margin-left 20px
0
   :color = !color1
0
 
0
@@ -33,6 +33,9 @@ p
0
   :margin-left 20px
0
   :color = !color1
0
 
0
+input
0
+ :display block
0
+
0
 p.history
0
   :text-align right
0
   :padding-right 20px

Comments

    No one has commented yet.