@@ -7,7 +7,8 @@ module PuppetReferences
77 PUPPET_DIR = BASE_DIR + 'vendor/openvox'
88 FACTER_DIR = BASE_DIR + 'vendor/openfact'
99 AGENT_DIR = BASE_DIR + 'vendor/openvox-agent'
10- OUTPUT_DIR = BASE_DIR + 'references_output'
10+ INSTALLPATH = ENV [ 'INSTALLPATH' ] ? ENV . fetch ( 'INSTALLPATH' ) : 'references_output'
11+ OUTPUT_DIR = BASE_DIR + INSTALLPATH
1112
1213 require 'puppet_references/config'
1314 require 'puppet_references/util'
@@ -37,7 +38,9 @@ def self.build_puppet_references(commit)
3738 ]
3839 config = PuppetReferences ::Config . read
3940 repo = PuppetReferences ::Repo . new ( 'openvox' , PUPPET_DIR , nil , config [ 'puppet' ] [ 'repo' ] )
40- real_commit = repo . checkout ( commit )
41+ version_commit = commit || repo . describe . split ( '-' ) [ 0 ]
42+ puts "Using tag #{ version_commit } "
43+ real_commit = repo . checkout ( version_commit )
4144 repo . update_bundle
4245 build_from_list_of_classes ( references , real_commit )
4346 end
@@ -54,11 +57,13 @@ def self.build_facter_references(commit)
5457 # we need the CLI docs for 3.y. We can remove this when we stop building 3.y.
5558 version4 = Gem ::Version . create ( '4.0.0' )
5659 repo = PuppetReferences ::Repo . new ( 'openfact' , FACTER_DIR )
57- real_commit = repo . checkout ( commit )
60+ version_commit = commit || repo . describe . split ( '-' ) [ 0 ]
61+ puts "Using tag #{ version_commit } "
62+ real_commit = repo . checkout ( version_commit )
5863 repo . update_bundle
59- if !semantic? ( commit ) || ( semantic? ( commit ) && Gem ::Version . create ( commit ) >= version4 )
64+ if !semantic? ( version_commit ) || ( semantic? ( version_commit ) && Gem ::Version . create ( version_commit ) >= version4 )
6065 references << PuppetReferences ::Facter ::FacterCli
61- elsif semantic? ( commit ) && Gem ::Version . create ( commit ) < version4
66+ elsif semantic? ( version_commit ) && Gem ::Version . create ( version_commit ) < version4
6267 reference = PuppetReferences ::Facter ::FacterCli . new ( real_commit )
6368 reference . build_v3_cli
6469 end
0 commit comments