mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-17 00:02:45 +08:00
Support Homebrew for fish shell (#75)
This commit is contained in:
parent
16e7007197
commit
bf666fadfd
|
@ -65,7 +65,7 @@ wr_homebrew_setsrc (char *option)
|
||||||
char *bashrc = "~/.bashrc";
|
char *bashrc = "~/.bashrc";
|
||||||
if (xy_file_exist (bashrc))
|
if (xy_file_exist (bashrc))
|
||||||
{
|
{
|
||||||
chsrc_backup ("~/.bashrc");
|
chsrc_backup (bashrc);
|
||||||
chsrc_append_to_file (splitter, bashrc);
|
chsrc_append_to_file (splitter, bashrc);
|
||||||
chsrc_append_to_file (api_domain, bashrc);
|
chsrc_append_to_file (api_domain, bashrc);
|
||||||
chsrc_append_to_file (bottle_domain, bashrc);
|
chsrc_append_to_file (bottle_domain, bashrc);
|
||||||
|
@ -73,7 +73,23 @@ wr_homebrew_setsrc (char *option)
|
||||||
chsrc_append_to_file (core_git_remote, bashrc);
|
chsrc_append_to_file (core_git_remote, bashrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
char *fishrc = "~/.config/fish/config.fish";
|
||||||
|
if (xy_file_exist (fishrc))
|
||||||
|
{
|
||||||
|
char *api_domain_fish = xy_strjoin(3, "set -x HOMEBREW_API_DOMAIN \"", xy_2strjoin(source.url, "homebrew-bottles/api"), "\"");
|
||||||
|
char *bottle_domain_fish = xy_strjoin(3, "set -x HOMEBREW_BOTTLE_DOMAIN \"", xy_2strjoin(source.url, "homebrew-bottles"), "\"");
|
||||||
|
char *brew_git_remote_fish = xy_strjoin(3, "set -x HOMEBREW_BREW_GIT_REMOTE \"", xy_2strjoin(source.url, "git/homebrew/brew.git"), "\"");
|
||||||
|
char *core_git_remote_fish = xy_strjoin(3, "set -x HOMEBREW_CORE_GIT_REMOTE \"", xy_2strjoin(source.url, "git/homebrew/homebrew-core.git"), "\"");
|
||||||
|
|
||||||
|
chsrc_backup (fishrc);
|
||||||
|
chsrc_append_to_file (splitter, fishrc);
|
||||||
|
chsrc_append_to_file (api_domain_fish, fishrc);
|
||||||
|
chsrc_append_to_file (bottle_domain_fish, fishrc);
|
||||||
|
chsrc_append_to_file (brew_git_remote_fish, fishrc);
|
||||||
|
chsrc_append_to_file (core_git_remote_fish, fishrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
chsrc_conclude(&source, ChsrcTypeAuto);
|
||||||
chsrc_note2 ("请您重启终端使Homebrew环境变量生效");
|
chsrc_note2 ("请您重启终端使Homebrew环境变量生效");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user