Skip to content

Commit

Permalink
handle symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
technillogue committed Jul 7, 2023
1 parent b06101e commit 447b498
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ func extractTarFile(buffer *bytes.Buffer, destDir string) error {
return err
}
targetFile.Close()
case tar.TypeSymlink:
if err := os.Symlink(header.Linkname, target); err != nil {
return err
}
default:
return fmt.Errorf("unsupported file type for %s", header.Name)
return fmt.Errorf("unsupported file type for %s, typeflag %s", header.Name, string(header.Typeflag))
}
}

Expand Down

0 comments on commit 447b498

Please sign in to comment.