lib/yle_tf/action/write_terraformrc_defaults.rb
def configure_plugin_cache_dir(file)
        Logger.info("Configuring global Terraform plugin cache by '#{RC_PATH}'")
        # Replace `~` with `$HOME` as it is not expanded correctly in all architectures.
        # Can't use `$HOME` in the constant though, as it won't be expanded by
        # `expand_path` below. Can't win this game.
        file.puts("plugin_cache_dir   = \"#{DEFAULT_PLUGIN_CACHE_PATH.sub(/^~/, '$HOME')}\"")

        dir = File.expand_path(DEFAULT_PLUGIN_CACHE_PATH)
        return if File.directory?(dir)

        Logger.debug("Creating the plugin cache dir '#{dir}'")
        FileUtils.mkdir_p(dir)
      end
# Path of the Terraform CLI configuration file
Path of the Terraform CLI configuration file
Path of the Terraform CLI configuration file
def configure_plugin_cache_dir(file)
        Logger.info("Configuring global Terraform plugin cache by '#{RC_PATH}'")
        file.puts("plugin_cache_dir   = \"#{DEFAULT_PLUGIN_CACHE_PATH.sub(/^~/, '$HOME')}\"")
        dir = File.expand_path(DEFAULT_PLUGIN_CACHE_PATH)
        return if File.directory?(dir)
        Logger.debug("Creating the plugin cache dir '#{dir}'")
        FileUtils.mkdir_p(dir)
      end
def configure_plugin_cache_dir ( file ) Logger . info ( "Configuring global Terraform plugin cache by '#{RC_PATH}'" ) file . puts ( "plugin_cache_dir   = \"#{DEFAULT_PLUGIN_CACHE_PATH.sub(/^~/, '$HOME')}\"" ) dir = File . expand_path ( DEFAULT_PLUGIN_CACHE_PATH ) return if File . directory? ( dir ) Logger . debug ( "Creating the plugin cache dir '#{dir}'" ) FileUtils . mkdir_p ( dir ) end
Path of the Terraform CLI configuration file
Path of the Terraform CLI configuration file
# Replace `~` with `$HOME` as it is not expanded correctly in all architectures. # Can't use `$HOME` in the constant though, as it won't be expanded by # `expand_path` below. Can't win this game.
file