Skip to content

Commit

Permalink
fix tar command so it contains a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
elg0nz committed Aug 29, 2024
1 parent e46228c commit f440c28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/file_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit f440c28

Please sign in to comment.