Fix truncate repos. Added path option to import · netdata-be/gitlab-shell@a7304fe · GitHub
Skip to content

Commit a7304fe

Browse files
committed
Fix truncate repos. Added path option to import
1 parent 918068d commit a7304fe

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion

‎bin/gitlab-projects‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ require_relative '../lib/gitlab_init'
1111
#
1212
# /bin/gitlab-projects rm-project gitlab/gitlab-ci.git
1313
#
14+
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
15+
#
1416
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
1517
GitlabProjects.new.exec
1618

‎lib/gitlab_projects.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def rm_project
4141
end
4242

4343
def import_project
44-
dir = @project_name.match(/[a-zA-Z\.\_\-]+\.git$/).to_s
45-
cmd = "cd #{@repos_path} && git clone --bare #{@project_name} #{dir} && #{create_hooks_cmd}"
44+
@source = ARGV.shift
45+
cmd = "cd #{@repos_path} && git clone --bare #{@source} #{@project_name} && #{create_hooks_cmd}"
4646
system(cmd)
4747
end
4848
end

‎support/truncate_repositories.sh‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)