Skip to content

Commit

Permalink
Merge pull request #378 from Dan33l/add-bzip2
Browse files Browse the repository at this point in the history
add bunzip2 filetype support
  • Loading branch information
Dan33l committed Aug 14, 2019
2 parents a866397 + 87a2613 commit e859abc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/puppet_x/bodeco/archive.rb
Expand Up @@ -140,6 +140,9 @@ def command(options)
when %r{(\.zip|\.war|\.jar)$}
opt = parse_flags('-o', options, 'zip')
"unzip #{opt} #{@file_path}"
when %r{(\.bz2)$}
opt = parse_flags('-d', options, 'bunzip2')
"bunzip2 #{opt} #{@file_path}"
else
raise NotImplementedError, "Unknown filetype: #{@file}"
end
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/puppet_x/bodeco/archive_spec.rb
Expand Up @@ -39,6 +39,8 @@
expect(tar.send(:command, :undef)).to eq 'unxz -dc test.tar.xz | tar xf -'
gunzip = described_class.new('test.gz')
expect(gunzip.send(:command, :undef)).to eq 'gunzip -d test.gz'
bunzip2 = described_class.new('test.bz2')
expect(bunzip2.send(:command, :undef)).to eq 'bunzip2 -d test.bz2'
zip = described_class.new('test.zip')
expect(zip.send(:command, :undef)).to eq 'unzip -o test.zip'
expect(zip.send(:command, '-a')).to eq 'unzip -a test.zip'
Expand Down

0 comments on commit e859abc

Please sign in to comment.