Skip to content

Commit

Permalink
Fix dir_exists?
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Dec 28, 2012
1 parent d03964d commit e9394c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/models/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ def human_name
end

def ensure_dir_exist
dir_exists? || system("mkdir -m 770 #{namespace_dir_path}")
unless dir_exists?
system("mkdir -m 770 #{namespace_full_path}")
end
end

def dir_exists?
namespace_dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
File.exists?(namespace_dir_path)
File.exists?(namespace_full_path)
end

def namespace_full_path
@namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
end

def move_dir
Expand Down

0 comments on commit e9394c4

Please sign in to comment.