Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teach brew about mksh #6122

Merged
merged 1 commit into from May 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions Library/Homebrew/utils/shell.rb
Expand Up @@ -11,7 +11,7 @@ def from_path(path)
shell_name = File.basename(path)
# handle possible version suffix like `zsh-5.2`
shell_name.sub!(/-.*\z/m, "")
shell_name.to_sym if %w[bash csh fish ksh sh tcsh zsh].include?(shell_name)
shell_name.to_sym if %w[bash csh fish ksh mksh sh tcsh zsh].include?(shell_name)
end

def preferred
Expand All @@ -25,7 +25,7 @@ def parent
# quote values. quoting keys is overkill
def export_value(key, value, shell = preferred)
case shell
when :bash, :ksh, :sh, :zsh
when :bash, :ksh, :mksh, :sh, :zsh
"export #{key}=\"#{sh_quote(value)}\""
when :fish
# fish quoting is mostly Bourne compatible except that
Expand Down Expand Up @@ -55,7 +55,7 @@ def set_variable_in_profile(variable, value)

def prepend_path_in_profile(path)
case preferred
when :bash, :ksh, :sh, :zsh, nil
when :bash, :ksh, :mksh, :sh, :zsh, nil
"echo 'export PATH=\"#{sh_quote(path)}:$PATH\"' >> #{profile}"
when :csh, :tcsh
"echo 'setenv PATH #{csh_quote(path)}:$PATH' >> #{profile}"
Expand All @@ -69,6 +69,7 @@ def prepend_path_in_profile(path)
csh: "~/.cshrc",
fish: "~/.config/fish/config.fish",
ksh: "~/.kshrc",
mksh: "~/.kshrc",
sh: "~/.bash_profile",
tcsh: "~/.tcshrc",
zsh: "~/.zshrc",
Expand Down