refactor(macos-shell): use new Environ
This commit is contained in:
@@ -7,8 +7,8 @@ pub fn getUsername(allocator: std.mem.Allocator, environ: std.process.Environ) !
|
|||||||
return try std.process.Environ.getAlloc(environ, allocator, "USER");
|
return try std.process.Environ.getAlloc(environ, allocator, "USER");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getShell(allocator: std.mem.Allocator) ![]u8 {
|
pub fn getShell(allocator: std.mem.Allocator, environ: std.process.Environ) ![]u8 {
|
||||||
const shell = std.process.getEnvVarOwned(allocator, "SHELL") catch |err| if (err == error.EnvironmentVariableNotFound) {
|
const shell = std.process.Environ.getAlloc(environ, allocator, "SHELL") catch |err| if (err == error.EnvironmentVariableNotFound) {
|
||||||
return allocator.dupe(u8, "Unknown");
|
return allocator.dupe(u8, "Unknown");
|
||||||
} else return err;
|
} else return err;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user