diff --git a/external/gpu_test.go b/external/gpu_test.go index b7f1eb6..7e45f9c 100644 --- a/external/gpu_test.go +++ b/external/gpu_test.go @@ -9,7 +9,7 @@ import ( func TestGPUInfo(t *testing.T) { t.Skip() - GPUsInfo, err := external.GPUInfoList() + result, err := external.GPUInfoList() assert.NilError(t, err) - assert.Equal(t, len(GPUsInfo), 1) + assert.Equal(t, len(result), 1) } diff --git a/utils/file/file.go b/utils/file/file.go index 66996ef..ddb6da7 100644 --- a/utils/file/file.go +++ b/utils/file/file.go @@ -418,11 +418,14 @@ func AddFile(ar archiver.Writer, path, commonPath string) error { defer file.Close() if path != commonPath { - filename := info.Name() + //filename := info.Name() + fpath := strings.Replace(path, commonPath, "", 1) + fpath = filepath.Join(filepath.Base(commonPath), fpath) + //filename := info.Name() err = ar.Write(archiver.File{ FileInfo: archiver.FileInfo{ FileInfo: info, - CustomName: filename, + CustomName: fpath, }, ReadCloser: file, })