feat: add restart with sudo capability

This commit is contained in:
CJ van den Berg 2025-11-24 13:01:15 +01:00
parent 8ccdc9654a
commit 51f74e37b8
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 36 additions and 11 deletions

View file

@ -33,6 +33,7 @@ pub const root = struct {
pub const exit = if (@hasDecl(hard_root, "exit")) hard_root.exit else dummy.exit;
pub const print_exit_status = if (@hasDecl(hard_root, "print_exit_status")) hard_root.print_exit_status else dummy.print_exit_status;
pub const set_restart_with_sudo = if (@hasDecl(hard_root, "set_restart_with_sudo")) hard_root.set_restart_with_sudo else dummy.set_restart_with_sudo;
pub const is_directory = if (@hasDecl(hard_root, "is_directory")) hard_root.is_directory else dummy.is_directory;
pub const is_file = if (@hasDecl(hard_root, "is_file")) hard_root.is_file else dummy.is_file;
@ -118,6 +119,9 @@ const dummy = struct {
pub fn print_exit_status(_: void, _: []const u8) void {
@panic("dummy print_exit_status call");
}
pub fn set_restart_with_sudo() void {
@panic("dummy set_restart_with_sudo call");
}
pub fn is_directory(_: []const u8) bool {
@panic("dummy is_directory call");