@@ -7,17 +7,19 @@ INCLUDED_PROJECTS = %w[agent-runtime openbolt-runtime].freeze
77def platforms
88 # First item will be a `- Platforms` header. Also exclude
99 # any platforms we don't actually build for or have problems parsing.
10- `bundle exec vanagon list -l` . split ( "\n " ) [ 1 ..]
11- . reject { |p | p =~ /(#{ IGNORED_PLATFORMS . join ( '|' ) } )/ }
10+ output = run_command ( 'bundle exec vanagon list -l' )
11+ output . split ( "\n " ) [ 1 ..]
12+ . reject { |p | p =~ /(#{ IGNORED_PLATFORMS . join ( '|' ) } )/ }
1213end
1314
1415def projects
1516 # First item will be a `- Projects` header. Also exclude
1617 # any projects prefixed with '_' as these are not real projects and
1718 # are shared between projects. Also ignore any projects we don't care
1819 # about.
19- `bundle exec vanagon list -r` . split ( "\n " ) [ 1 ..]
20- . reject { |p | p . start_with? ( '_' ) || p !~ /^(#{ INCLUDED_PROJECTS . join ( '|' ) } )/ }
20+ output = run_command ( 'bundle exec vanagon list -r' )
21+ output . split ( "\n " ) [ 1 ..]
22+ . reject { |p | p . start_with? ( '_' ) || p !~ /^(#{ INCLUDED_PROJECTS . join ( '|' ) } )/ }
2123end
2224
2325# Sometimes the version is a git ref so extract
@@ -37,7 +39,8 @@ def component_info
3739
3840 platforms . each do |platform |
3941 puts " #{ platform } "
40- platform_data = JSON . parse ( `bundle exec vanagon inspect #{ project } #{ platform } ` )
42+ output = run_command ( "bundle exec vanagon inspect #{ project } #{ platform } " )
43+ platform_data = JSON . parse ( output )
4144 project_data [ project ] [ platform ] = platform_data . map { |h | [ h [ 'name' ] , h [ 'version' ] || h . dig ( 'options' , 'ref' ) ] } . to_h
4245 end
4346 end
@@ -76,18 +79,16 @@ namespace :vox do
7679 desc 'Regenerate component_info.json with all tags'
7780 task :regenerate_component_info do
7881 # Clone a copy of the repo to avoid messing up the current working dir
79- ` git clone https://github.com/openvoxproject/puppet-runtime puppet-runtime-tmp`
82+ run_command ( ' git clone https://github.com/openvoxproject/puppet-runtime puppet-runtime-tmp' )
8083 begin
8184 all_data = { }
8285 Dir . chdir ( 'puppet-runtime-tmp' ) do
83- `git fetch origin --tags --prune --prune-tags`
84- `git tag --sort=creatordate | awk '$0=="#{ FIRST_TAG } "{seen=1; next} seen'` . split ( "\n " ) . each do |tag |
86+ run_command ( 'git fetch origin --tags --prune --prune-tags' )
87+ output = run_command ( "git tag --sort=creatordate | awk '$0==\" #{ FIRST_TAG } \" {seen=1; next} seen'" )
88+ output . split ( "\n " ) . each do |tag |
8589 puts "Checking out tag #{ tag } ..."
86- `git checkout #{ tag } `
87- Bundler . with_unbundled_env do
88- `BUNDLER_GEMFILE=./Gemfile bundle install --path .bundle`
89- all_data [ tag ] = component_info
90- end
90+ run_command ( "git checkout #{ tag } " )
91+ all_data [ tag ] = component_info
9192 end
9293 end
9394 # Reverse order to latest is on top
0 commit comments