MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / isPrivilegeError

Function isPrivilegeError

internal/instructions/install.go:26–40  ·  view source on GitHub ↗

isPrivilegeError reports whether err indicates symlink creation was denied for lack of privilege (the Windows non-developer-mode case).

(err error)

Source from the content-addressed store, hash-verified

24// isPrivilegeError reports whether err indicates symlink creation was denied
25// for lack of privilege (the Windows non-developer-mode case).
26func isPrivilegeError(err error) bool {
27 if err == nil {
28 return false
29 }
30 if strings.Contains(strings.ToLower(err.Error()), "privilege") {
31 return true
32 }
33 // syscall.Errno on Windows compares equal to the numeric code.
34 type numbered interface{ Errno() uintptr }
35 var n numbered
36 if errors.As(err, &n) && n.Errno() == windowsPrivilegeNotHeld {
37 return true
38 }
39 return false
40}
41
42// Install links the instruction identified by id into the coding-agent path
43// for (app, level, projectDir), using a symlink with a copy fallback.

Callers 1

InstallMethod · 0.85

Calls 2

ErrnoMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected