Skip to content

Commit dcb1e16

Browse files
committed
fix(cmd/rofl/build): also resolve outputDir in extractArchive
On macOS Docker /var is a symlink to /private/var, so we need to resolve the outputDir to prevent errors when checking the prefix matching.
1 parent 64dbccc commit dcb1e16

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/rofl/build/artifacts.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ func maybeDownloadArtifact(kind, uri string) string {
119119

120120
// extractArchive extracts the given tar.bz2 archive into the target output directory.
121121
func extractArchive(fn, outputDir string) error {
122+
resolvedOutputDir, err := filepath.EvalSymlinks(outputDir)
123+
if err != nil {
124+
return fmt.Errorf("unable to resolve output path: %w", err)
125+
}
126+
outputDir = resolvedOutputDir
127+
122128
f, err := os.Open(fn)
123129
if err != nil {
124130
return fmt.Errorf("failed to open archive: %w", err)

0 commit comments

Comments
 (0)