mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 20:39:05 +00:00
windows: changes to install/upgrade/uninstallation process (#9025)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user