Files
RemLink/internal/identity/path_windows.go
T
qsc20001102 142e5dc7d6
ci / Go checks (ubuntu-latest) (push) Has been cancelled
ci / Go checks (windows-latest) (push) Has been cancelled
初版功能完成
2026-08-29 13:12:17 +08:00

28 lines
664 B
Go

//go:build windows
package identity
import (
"errors"
"path/filepath"
"remlink/internal/appdir"
"remlink/internal/model"
)
// DefaultPath returns the portable identity path beside the role executable.
// Engineer and Site are shipped in different directories, so the common file
// name cannot collide across the two package bodies.
func DefaultPath(nodeType model.NodeType) (string, error) {
switch nodeType {
case model.NodeTypeEngineer, model.NodeTypeSite:
root, err := appdir.Executable()
if err != nil {
return "", err
}
return filepath.Join(root, "identity.json"), nil
default:
return "", errors.New("invalid Windows Node type")
}
}