Sha256: 3e43ed84ca05cc81828ef22aa8932ae11ce05d368b2d344c89f619aa8a02dbc4

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

package "git"

scheme = node[:tfenv][:scheme]
tfenv_root = node[:tfenv][:tfenv_root]

git tfenv_root do
  repository "#{scheme}://github.com/tfutils/tfenv.git"
  user node[:tfenv][:user] if node[:tfenv][:user]
end

directory File.join(tfenv_root, "plugins") do
  user node[:tfenv][:user] if node[:tfenv][:user]
end

tfenv_init = <<-TFENV_INIT
  export TFENV_ROOT=#{tfenv_root}
  export PATH="#{tfenv_root}/bin:${PATH}"
TFENV_INIT

node[:tfenv][:versions].each do |version|
  execute "tfenv install #{version}" do
    command "#{tfenv_init} tfenv install #{version}"
    not_if  "#{tfenv_init} tfenv list | grep #{version}"
    user node[:tfenv][:user] if node[:tfenv][:user]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
itamae-plugin-recipe-tfenv-0.1.1 lib/itamae/plugin/recipe/tfenv/install.rb