新增RunAsAdmin方法
This commit is contained in:
@@ -42,6 +42,11 @@ type Platform interface {
|
||||
|
||||
// InstallFont 安装字体
|
||||
InstallFont(ctx context.Context, fontPath string) error
|
||||
|
||||
// RunAsAdmin 以管理员/root 权限运行命令
|
||||
// Windows 上通过 UAC 对话框提升权限
|
||||
// Linux/macOS 上通过 sudo 获取 root 权限
|
||||
RunAsAdmin(ctx context.Context, name string, args ...string) error
|
||||
}
|
||||
|
||||
// Detect 检测当前平台并返回对应的 Platform 实现
|
||||
|
||||
Reference in New Issue
Block a user