spaarti 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spaarti/repo.rb +14 -2
- data/lib/spaarti/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ffdddcf2bd07ff424eda7dc49c80e333f6569fa
|
4
|
+
data.tar.gz: a884ea9643714fc5c383995e66864db50182c1f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4ee04f9fa24c005ab402b6671e89ba358092ae2503cb283bbc93ae88d671d754b97f805d12867559f3b67dfa31f77e862d95e53c4125972d70e93b0b26bb497
|
7
|
+
data.tar.gz: 15158974c8bb0f6d3da9e08131b2d22489f5d1602ef20b40ca89c5894f655d2e5d8c92f82446de3c281c78c9e7c94a62fd876564b2346297872a63e41c7a29f1
|
data/lib/spaarti/repo.rb
CHANGED
@@ -12,9 +12,12 @@ module Spaarti
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def sync!
|
15
|
-
return log("#{@data[:full_name]} already cloned") if Dir.exist?(@path)
|
16
15
|
clone
|
17
|
-
Dir.chdir(@path)
|
16
|
+
Dir.chdir(@path) do
|
17
|
+
config
|
18
|
+
add_upstream
|
19
|
+
update_submodules
|
20
|
+
end
|
18
21
|
end
|
19
22
|
|
20
23
|
def parent_of(repo)
|
@@ -37,6 +40,7 @@ module Spaarti
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def clone
|
43
|
+
return log("#{@data[:full_name]} already cloned") if Dir.exist? @path
|
40
44
|
log "Cloning #{@data[:ssh_url]} to #{@path}"
|
41
45
|
run(
|
42
46
|
"git clone '#{@data[:ssh_url]}' '#{@path}' &>/dev/null",
|
@@ -52,11 +56,19 @@ module Spaarti
|
|
52
56
|
|
53
57
|
def add_upstream
|
54
58
|
return unless @data[:fork]
|
59
|
+
return if `git remote`.split.include? 'upstream'
|
55
60
|
upstream = @client.repo(@data[:id]).source.git_url
|
56
61
|
run(
|
57
62
|
"git remote add upstream '#{upstream}'",
|
58
63
|
"Failed to add upstrema for #{@path}"
|
59
64
|
)
|
60
65
|
end
|
66
|
+
|
67
|
+
def update_submodules
|
68
|
+
run(
|
69
|
+
'git submodule update --init',
|
70
|
+
"Failed to update submodules in #{@path}"
|
71
|
+
)
|
72
|
+
end
|
61
73
|
end
|
62
74
|
end
|
data/lib/spaarti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spaarti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
182
|
+
rubygems_version: 2.4.5
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Helper for cloning GitHub repos
|