Skip to content

Commit

Permalink
fix: directory cannot be found when decompressing soft link files (#199)
Browse files Browse the repository at this point in the history
Co-authored-by: c0febean <zksrw@ghost>
  • Loading branch information
c0febean and c0febean authored Apr 12, 2024
1 parent 25016e3 commit 2631550
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/util/decompressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ loop:
}
}
for _, s := range symlinks {
dir := filepath.Dir(s.newname)
if _, err := os.Stat(dir); os.IsNotExist(err) {
if err := os.MkdirAll(dir, 0755); err != nil {
return err
}
}
if err = os.Symlink(s.oldname, s.newname); err != nil {
return err
}
Expand Down Expand Up @@ -171,6 +177,12 @@ loop:
}
}
for _, s := range symlinks {
dir := filepath.Dir(s.newname)
if _, err := os.Stat(dir); os.IsNotExist(err) {
if err := os.MkdirAll(dir, 0755); err != nil {
return err
}
}
if err = os.Symlink(s.oldname, s.newname); err != nil {
return err
}
Expand Down

0 comments on commit 2631550

Please sign in to comment.