diff --git a/lib/terraform/runner.rb b/lib/terraform/runner.rb index 0d90223..fe9f716 100644 --- a/lib/terraform/runner.rb +++ b/lib/terraform/runner.rb @@ -170,8 +170,7 @@ def encoded_zip_from_directory(template_path) Tempfile.create(%w[opentofu-runner-payload .zip]) do |zip_file_path| _log.debug("Create #{zip_file_path}") Zip::File.open(zip_file_path, Zip::File::CREATE) do |zipfile| - Dir.chdir(dir_path) - Dir.glob("**/*").select { |fn| File.file?(fn) }.each do |file| + Dir.glob(File.join(dir_path, "/**/*")).select { |fn| File.file?(fn) }.each do |file| _log.debug("Adding #{file}") zipfile.add(file.sub("#{dir_path}/", ''), file) end