From f440c2861e4ffd29d84963bd810480f303413309 Mon Sep 17 00:00:00 2001 From: elg0nz Date: Wed, 28 Aug 2024 22:00:22 -0700 Subject: [PATCH] fix tar command so it contains a single file --- lib/file_handler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/file_handler.rb b/lib/file_handler.rb index 2e8a941..c8876c0 100644 --- a/lib/file_handler.rb +++ b/lib/file_handler.rb @@ -32,8 +32,8 @@ def create_tar_gz_files(files) tar_gz_file = "#{tar_file}.gz" unless File.exist?(tar_gz_file) - # Create tarball - system("tar -cf #{tar_file} #{file}") + # Create tarball containing only the file without directory structure + system("tar -C #{File.dirname(file)} -cf #{tar_file} #{File.basename(file)}") # Compress tarball system("gzip #{tar_file}")