Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 committed Sep 19, 2024
1 parent e5b33b7 commit 38d76ba
Show file tree
Hide file tree
Showing 39 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion unarchive/archive.go → archive/archive.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package unarchive
package archive

import (
"fmt"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions unarchive/unarchive.go → archive/unarchive.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package unarchive
package archive

import (
"encoding/json"
Expand Down Expand Up @@ -33,7 +33,7 @@ func IsSupportedArchive(filePath string) bool {
return ok
}

// The 'archiver' dependency includes an API called 'Unarchive' to extract archive files. This API uses the archive file
// The 'archive' dependency includes an API called 'Unarchive' to extract archive files. This API uses the archive file
// extension to determine the archive type.
// We therefore need to use the file name as it was in Artifactory, and not the file name which was downloaded. To achieve this,
// we added a new implementation of the 'Unarchive' func and use it instead of the default one.
Expand All @@ -58,7 +58,7 @@ func (u *Unarchiver) Unarchive(archivePath, archiveName, destinationPath string)
return unarchiver.Unarchive(archivePath, destinationPath)
}

// Instead of using 'archiver.byExtension' that by default sets OverwriteExisting to false, we implement our own.
// Instead of using 'archive.byExtension' that by default sets OverwriteExisting to false, we implement our own.
func (u *Unarchiver) byExtension(filename string) (interface{}, error) {
var ec interface{}
for _, c := range supportedArchives {
Expand Down
16 changes: 8 additions & 8 deletions unarchive/unarchive_test.go → archive/unarchive_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package unarchive
package archive

import (
"os"
Expand All @@ -16,13 +16,13 @@ func TestUnarchive(t *testing.T) {
// Create temp directory
tmpDir := t.TempDir()

// Run unarchive on archive created on Unix
// Run archive on archive created on Unix
err := runUnarchive(t, uarchiver, "unix."+extension, "archives", filepath.Join(tmpDir, "unix"))
assert.NoError(t, err)
assert.FileExists(t, filepath.Join(tmpDir, "unix", "link"))
assert.FileExists(t, filepath.Join(tmpDir, "unix", "dir", "file"))

// Run unarchive on archive created on Windows
// Run archive on archive created on Windows
err = runUnarchive(t, uarchiver, "win."+extension, "archives", filepath.Join(tmpDir, "win"))
assert.NoError(t, err)
assert.FileExists(t, filepath.Join(tmpDir, "win", "link.lnk"))
Expand Down Expand Up @@ -50,7 +50,7 @@ func TestUnarchiveSymlink(t *testing.T) {
// Create temp directory
tmpDir := t.TempDir()

// Run unarchive
// Run archive
err := runUnarchive(t, uarchiver, testCase.prefix+"."+extension, "archives", tmpDir)
assert.NoError(t, err)

Expand Down Expand Up @@ -104,13 +104,13 @@ func TestUnarchiveWithStripComponents(t *testing.T) {
// Create temp directory
tmpDir := t.TempDir()

// Run unarchive on archive created on Unix
// Run archive on archive created on Unix
err := runUnarchive(t, uarchiver, "strip-components."+extension, "archives", filepath.Join(tmpDir, "unix"))
assert.NoError(t, err)
assert.DirExists(t, filepath.Join(tmpDir, "unix", "nested_folder_1"))
assert.DirExists(t, filepath.Join(tmpDir, "unix", "nested_folder_2"))

// Run unarchive on archive created on Windows
// Run archive on archive created on Windows
err = runUnarchive(t, uarchiver, "strip-components."+extension, "archives", filepath.Join(tmpDir, "win"))
assert.NoError(t, err)
assert.DirExists(t, filepath.Join(tmpDir, "win", "nested_folder_1"))
Expand All @@ -119,12 +119,12 @@ func TestUnarchiveWithStripComponents(t *testing.T) {
}
}

// Test unarchive file with a directory named "." in the root directory
// Test archive file with a directory named "." in the root directory
func TestUnarchiveDotDir(t *testing.T) {
// Create temp directory
tmpDir := t.TempDir()

// Run unarchive
// Run archive
err := runUnarchive(t, Unarchiver{}, "dot-dir.tar.gz", "archives", tmpDir+string(os.PathSeparator))
assert.NoError(t, err)
assert.DirExists(t, filepath.Join(tmpDir, "dir"))
Expand Down

0 comments on commit 38d76ba

Please sign in to comment.