spaarti 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9501ed9a2cb2142fbc89cc429c135e5a0dbf218d
4
- data.tar.gz: da13d0c46525dcad7c81f0138a58b6440cc9ab90
3
+ metadata.gz: 4ffdddcf2bd07ff424eda7dc49c80e333f6569fa
4
+ data.tar.gz: a884ea9643714fc5c383995e66864db50182c1f6
5
5
  SHA512:
6
- metadata.gz: 7ee8ca0b26a6225daa53564d9343dabe76a2e9d650068c8e46ce7b14ad26eb489b3479371708252eb5e32ee214af2567172f8b44f3ea16d48d2f36ad95d6e6f9
7
- data.tar.gz: 7e1b2dacd94a671a469365bbbc0067eaa91839969c29a3b9727dd98cd0600959ed463d5f78b3a5c546b02067935344c88782ce3eeefed23a42fead6ebed0af9c
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) { config && add_upstream }
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
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Set the version (needed for Mercenary -v)
3
3
  module Spaarti
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
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
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-10 00:00:00.000000000 Z
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.2.2
182
+ rubygems_version: 2.4.5
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: Helper for cloning GitHub repos