Skip to content

Commit 3010f65

Browse files
committed
feat(cp): handle stat errors from PathInfo.Error field
Update hypeman-go dependency with new Error field in PathInfo. Now properly reports stat failures like permission denied instead of treating them as 'path does not exist'.
1 parent 1e1e40c commit 3010f65

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/gorilla/websocket v1.5.3
1313
github.com/itchyny/json2yaml v0.1.4
1414
github.com/muesli/reflow v0.3.0
15-
github.com/onkernel/hypeman-go v0.7.1-0.20251223041508-172fee813a06
15+
github.com/onkernel/hypeman-go v0.7.1-0.20251223043134-e172b69eca2b
1616
github.com/tidwall/gjson v1.18.0
1717
github.com/tidwall/pretty v1.2.1
1818
github.com/urfave/cli-docs/v3 v3.0.0-alpha6

pkg/cmd/cp.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ func statGuestPath(ctx context.Context, client *hypeman.Client, instanceID, gues
284284
return nil, fmt.Errorf("stat path: %w", err)
285285
}
286286

287+
// Check for stat errors (e.g., permission denied)
288+
if pathInfo.Error != "" {
289+
return nil, fmt.Errorf("stat path %s: %s", guestPath, pathInfo.Error)
290+
}
291+
287292
return pathInfo, nil
288293
}
289294

0 commit comments

Comments
 (0)