librarian-puppet-simple 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: f58631425b926315afa614b8ce03aa0b7624cf2c
4
- data.tar.gz: 1cef5b57b773f3144f45023135f1e377f9da5ab6
3
+ metadata.gz: 09800d8e71a73911ccabd72a8379f7a2cbac65b2
4
+ data.tar.gz: 524f5ac5d7ab555a0cfe646f353d3513be8714a5
5
5
  SHA512:
6
- metadata.gz: 4faf4128ef7afee2111b8d55808ea4eec47a5238e1d312fdcacfc3229dd9f9226e31ed2fe97db7fd9dd44ad9e16b7b9e3a5067bf49218cfccb6f2d452e55833d
7
- data.tar.gz: 87072db0e6f498cc160c422eada82136bc6297aac4e35edbbd59ddc54779fd92dadbd0f0e327cf388b428d45fd71962cd6a7a0f17273b1736ba803f31f3ea298
6
+ metadata.gz: dc7acd69bcd90b75c3bf4d3a82a76790a931ee54c6fa4bbaeb928ec3a2bc65b6bee9c39a715be46238a266917ae81d39121533c12837f1a452fcf5058967613f
7
+ data.tar.gz: a49a961ed7337fbe99ac796b05349758af92da5eda2bbedab2009f6748b217e9613a0172a65ac6547bc7e04be0c0d80e50831fc69d3e1b34dea52afe63313112
@@ -43,17 +43,21 @@ module Librarian
43
43
  @custom_module_path = options[:path]
44
44
  eval(File.read(File.expand_path(options[:puppetfile])))
45
45
  each_module_of_type(:git) do |repo|
46
- Dir.chdir(File.join(module_path, repo[:name])) do
47
- remote = repo[:git]
48
- # if no ref is given, assume master
49
- branch = repo[:ref] || 'master'
50
- if branch =~ /^origin\/(.*)$/
51
- branch = $1
46
+ if Dir.exists?(File.join(module_path, repo[:name]))
47
+ Dir.chdir(File.join(module_path, repo[:name])) do
48
+ remote = repo[:git]
49
+ # if no ref is given, assume master
50
+ branch = repo[:ref] || 'master'
51
+ if branch =~ /^origin\/(.*)$/
52
+ branch = $1
53
+ end
54
+ co_cmd = 'git checkout FETCH_HEAD'
55
+ update_cmd = "git fetch #{repo[:git]} #{branch} && #{co_cmd}"
56
+ print_verbose "\n\n#{repo[:name]} -- #{update_cmd}"
57
+ git_pull_cmd = system_cmd(update_cmd)
52
58
  end
53
- co_cmd = 'git checkout FETCH_HEAD'
54
- update_cmd = "git fetch #{repo[:git]} #{branch} && #{co_cmd}"
55
- print_verbose "\n\n#{repo[:name]} -- #{update_cmd}"
56
- git_pull_cmd = system_cmd(update_cmd)
59
+ else
60
+ install_git module_path, repo[:name], repo[:git], repo[:ref]
57
61
  end
58
62
  end
59
63
  end
@@ -1,7 +1,7 @@
1
1
  module Librarian
2
2
  module Puppet
3
3
  module Simple
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librarian-puppet-simple
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
  - Dan Bode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor