Skip to content

Commit

Permalink
Fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ystros committed Dec 3, 2024
1 parent 4195a79 commit ccf95f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 6 additions & 6 deletions fileutil/tarball_compressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

type tarballCompressor struct {
fs boshsys.FileSystem
fs boshsys.FileSystem
}

func NewTarballCompressor(
Expand Down Expand Up @@ -98,7 +98,7 @@ func (c tarballCompressor) CompressSpecificFilesInDir(dir string, files []string
return "", bosherr.WrapError(err, "Creating tgz")
}

if err = tw.Close(); err != nil {
if err = tw.Close(); err != nil {
return "", bosherr.WrapError(err, "Closing tar writer")
}

Expand Down Expand Up @@ -140,7 +140,7 @@ func (c tarballCompressor) DecompressFileToDir(tarballPath string, dir string, o

if options.PathInArchive != "" && !strings.HasPrefix(
filepath.Clean(header.Name), filepath.Clean(options.PathInArchive)) {
continue
continue
}

fullName := filepath.Join(dir, filepath.FromSlash(header.Name))
Expand Down Expand Up @@ -171,12 +171,12 @@ func (c tarballCompressor) DecompressFileToDir(tarballPath string, dir string, o
}

case tar.TypeLink:
if err := c.fs.Symlink(header.Linkname, fullName); err != nil {
if err := c.fs.Symlink(header.Linkname, fullName); err != nil {
return bosherr.WrapError(err, "Decompressing link")
}

case tar.TypeSymlink:
if err := c.fs.Symlink(header.Linkname, fullName); err != nil {
case tar.TypeSymlink:
if err := c.fs.Symlink(header.Linkname, fullName); err != nil {
return bosherr.WrapError(err, "Decompressing symlink")
}

Expand Down
4 changes: 1 addition & 3 deletions fileutil/tarball_compressor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ var _ = Describe("tarballCompressor", func() {
"other_logs/more_logs/more.stdout.log",
))


content, err := fs.ReadFileString(filepath.FromSlash(dstDir + "/app.stdout.log"))
Expect(err).ToNot(HaveOccurred())
Expect(content).To(ContainSubstring("this is app stdout"))
Expand Down Expand Up @@ -250,7 +249,7 @@ var _ = Describe("tarballCompressor", func() {

var (
tarballPath string
fs *fakesys.FakeFileSystem
fs *fakesys.FakeFileSystem
)

BeforeEach(func() {
Expand All @@ -267,7 +266,6 @@ var _ = Describe("tarballCompressor", func() {
Expect(err).ToNot(HaveOccurred())
})


It("uses no same owner option", func() {
compressor := NewTarballCompressor(fs)
err := compressor.DecompressFileToDir(tarballPath, dstDir, CompressorOptions{})
Expand Down

0 comments on commit ccf95f5

Please sign in to comment.