stash-clone-tool 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/stash-clone-tool +5 -1
- data/lib/stash_clone_tool/stash_cloner.rb +2 -2
- data/lib/stash_clone_tool/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc0c2e451d5b95515b8fabb49a9b5434b74272f
|
4
|
+
data.tar.gz: d11214d327c15303273c511fddef2dd962f71c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40697ffa50eff766402177e4899b94ad1ebe67ed16e433c905c1bd2700ef531c144be4ce0728c25ffb1171a53ab0a41b21dcfe456f5c119dfd0d50a5c9ac8f15
|
7
|
+
data.tar.gz: 88f9e018d26ec1c8528165025ce1f652883dc13aeac75767c3a32b91f30c93cf71bec8c1b50212f12c08a081005ab01f6aa5f9c248a882ec4395e534068c0fdb
|
data/bin/stash-clone-tool
CHANGED
@@ -5,6 +5,7 @@ require 'stash_clone_tool/stash_cloner'
|
|
5
5
|
require 'optparse'
|
6
6
|
require 'highline/import'
|
7
7
|
options = {directory: '.'}
|
8
|
+
clone_options = {}
|
8
9
|
cli = OptionParser.new do |opts|
|
9
10
|
opts.banner = 'Usage: stash-clone-tool [options]'
|
10
11
|
opts.on('-s', '--stash URL', 'Stash Server URL (required)') do |stash_url|
|
@@ -19,6 +20,9 @@ cli = OptionParser.new do |opts|
|
|
19
20
|
opts.on('-d', '--directory DIRECTORY_PATH', 'Path to clone stash projects into (default: working directory).') do |directory|
|
20
21
|
options[:directory] = directory
|
21
22
|
end
|
23
|
+
opts.on('--depth DEPTH', 'Clone depth (assumes single branch unless --no-single-branch).') do |depth|
|
24
|
+
clone_options[:depth] = depth
|
25
|
+
end
|
22
26
|
end.parse!
|
23
27
|
|
24
28
|
fail 'Must specify Stash server URL (-s).' if options[:stash_url].nil?
|
@@ -30,7 +34,7 @@ options[:password] ||= ask('Password: ') { |q| q.echo = '*' }
|
|
30
34
|
@last_project = nil
|
31
35
|
cloner = StashCloneTool::StashCloner.new(options[:stash_url], options[:username], options[:password], options[:directory])
|
32
36
|
|
33
|
-
cloner.clone_stash do |on|
|
37
|
+
cloner.clone_stash(clone_options) do |on|
|
34
38
|
on.initialize_repository do |repository, folder|
|
35
39
|
if @last_project != repository.project
|
36
40
|
puts " - #{repository.project.name}...".light_yellow
|
@@ -15,7 +15,7 @@ module StashCloneTool
|
|
15
15
|
@directory = directory
|
16
16
|
end
|
17
17
|
|
18
|
-
def clone_stash
|
18
|
+
def clone_stash(clone_options)
|
19
19
|
wrapper = Multiblock.wrapper
|
20
20
|
yield(wrapper)
|
21
21
|
@stash.projects.each do |project|
|
@@ -26,7 +26,7 @@ module StashCloneTool
|
|
26
26
|
if Dir.exists?(folder)
|
27
27
|
wrapper.call(:failure, repository, 'Target already exists')
|
28
28
|
else
|
29
|
-
Git.clone(clone_link, folder)
|
29
|
+
Git.clone(clone_link, folder, clone_options)
|
30
30
|
wrapper.call(:success, repository)
|
31
31
|
end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stash-clone-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Ridgway
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-04-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|