8000 fix(sdk): need basepath instead of file absolute path (#4902) · ovh/cds@dab0aa8 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit dab0aa8

Browse files
sguiheuxrichardlt
authored andcommitted
fix(sdk): need basepath instead of file absolute path (#4902)
1 parent 527be9d commit dab0aa8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sdk/cache.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,13 @@ func CreateTarFromPaths(fs afero.Fs, cwd string, paths []string, opts *TarOption
8484
header.Name = strings.TrimPrefix(strings.TrimPrefix(header.Name, opts.TrimDirName), string(filepath.Separator))
8585
}
8686
if fi.Mode()&os.ModeSymlink != 0 {
87+
8788
symlink, errEval := filepath.EvalSymlinks(file)
8889
if errEval != nil {
8990
return errEval
9091
}
91-
abs, errAbs := filepath.Abs(header.Name)
92-
if errAbs != nil {
93-
return errAbs
94-
}
92+
93+
abs := filepath.Dir(filepath.Join(cwd, header.Name))
9594

9695
symlinkRel, errRel := filepath.Rel(abs, symlink)
9796
if errRel != nil {

0 commit comments

Comments
 (0)
0