Skip to content

Commit

Permalink
Merge pull request #76 from agrare/remove_useless_chdir_terraform_runner
Browse files Browse the repository at this point in the history
Remove useless Dir.chdir in Terraform::Runner
  • Loading branch information
Fryguy authored Sep 30, 2024
2 parents 707fe67 + 5746b75 commit 5a1a762
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/terraform/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a1a762

Please sign in to comment.