Fix dir_exists?
This commit is contained in:
parent
d03964d6ec
commit
e9394c48ca
1 changed files with 8 additions and 3 deletions
|
@ -51,12 +51,17 @@ class Namespace < ActiveRecord::Base
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue