summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-09 15:04:53 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-09 15:04:53 +0200
commita7304fe0600aaaebe46d984954ca4f12707e00e5 (patch)
tree2ed2e39c82208b24bd4abc88c4b3f1c214f9904c
parent918068df610f07a0371a3f5a477a28b8f370b89a (diff)
downloadgitlab-shell-1.0.3.tar.gz
Fix truncate repos. Added path option to importv1.0.3
-rw-r--r--README.md2
-rwxr-xr-xbin/gitlab-projects2
-rw-r--r--lib/gitlab_projects.rb4
-rwxr-xr-xsupport/truncate_repositories.sh2
4 files changed, 6 insertions, 4 deletions
diff --git a/README.md b/README.md
index 35aac32..cbf1268 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Remove repo
Import repo
- ./bin/gitlab-projects import-project https://github.com/randx/six.git
+ ./bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
### Keys:
diff --git a/bin/gitlab-projects b/bin/gitlab-projects
index f34706f..3f7a102 100755
--- a/bin/gitlab-projects
+++ b/bin/gitlab-projects
@@ -11,6 +11,8 @@ require_relative '../lib/gitlab_init'
#
# /bin/gitlab-projects rm-project gitlab/gitlab-ci.git
#
+# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
+#
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
GitlabProjects.new.exec
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
index 4cd337a..b9eb36a 100644
--- a/lib/gitlab_projects.rb
+++ b/lib/gitlab_projects.rb
@@ -41,8 +41,8 @@ class GitlabProjects
end
def import_project
- dir = @project_name.match(/[a-zA-Z\.\_\-]+\.git$/).to_s
- cmd = "cd #{@repos_path} && git clone --bare #{@project_name} #{dir} && #{create_hooks_cmd}"
+ @source = ARGV.shift
+ cmd = "cd #{@repos_path} && git clone --bare #{@source} #{@project_name} && #{create_hooks_cmd}"
system(cmd)
end
end
diff --git a/support/truncate_repositories.sh b/support/truncate_repositories.sh
index 3711d6e..66ff972 100755
--- a/support/truncate_repositories.sh
+++ b/support/truncate_repositories.sh
@@ -6,7 +6,7 @@ echo "Danger!!! Data Loss"
while true; do
read -p "Do you wish to delete all directories (except gitolite-admin.git) from $home_dir/repositories/ (y/n) ?: " yn
case $yn in
- [Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs sudo rm -rf"; break;;
+ [Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac