windows: changes to install/upgrade/uninstallation process (#9025)

This commit is contained in:
dave caruso
2024-02-27 03:11:43 -08:00
committed by GitHub
parent fd6fd78f0f
commit 4e2d00d052
13 changed files with 430 additions and 130 deletions

View File

@@ -15,6 +15,7 @@ pub const Shell = enum {
bash,
zsh,
fish,
pwsh,
const bash_completions = @import("root").completions.bash;
const zsh_completions = @import("root").completions.zsh;
@@ -32,13 +33,17 @@ pub const Shell = enum {
pub fn fromEnv(comptime Type: type, SHELL: Type) Shell {
const basename = std.fs.path.basename(SHELL);
if (strings.eqlComptime(basename, "bash")) {
return Shell.bash;
return .bash;
} else if (strings.eqlComptime(basename, "zsh")) {
return Shell.zsh;
return .zsh;
} else if (strings.eqlComptime(basename, "fish")) {
return Shell.fish;
return .fish;
} else if (strings.eqlComptime(basename, "pwsh") or
strings.eqlComptime(basename, "powershell"))
{
return .pwsh;
} else {
return Shell.unknown;
return .unknown;
}
}
};