From 18b4d39ac7172cb02cec63e7bf1cc21807a9b3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Wed, 29 Jun 2016 13:58:20 -0400 Subject: Refactor repository paths handling to allow multiple git mount points --- bin/install | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/install') diff --git a/bin/install b/bin/install index 9847ae1..73ac592 100755 --- a/bin/install +++ b/bin/install @@ -8,16 +8,20 @@ require_relative '../lib/gitlab_init' config = GitlabConfig.new key_dir = File.dirname("#{config.auth_file}") +repository_storage_paths = ARGV commands = [ - %W(mkdir -p #{config.repos_path}), %W(mkdir -p #{key_dir}), %W(chmod 700 #{key_dir}), %W(touch #{config.auth_file}), %W(chmod 600 #{config.auth_file}), - %W(chmod ug+rwX,o-rwx #{config.repos_path}), ] +repository_storage_paths.each do |repository_storage_path| + commands << %W(mkdir -p #{repository_storage_path}) + commands << %W(chmod ug+rwX,o-rwx #{repository_storage_path}) +end + commands.each do |cmd| print "#{cmd.join(' ')}: " if system(*cmd) -- cgit v1.2.1