mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-08 05:43:15 +08:00
Support winget
[Gitee link #I9W0SE]
This commit is contained in:
parent
5fd8e86fb9
commit
e4c71aa56d
25
src/chsrc.c
25
src/chsrc.c
@ -1772,6 +1772,26 @@ wr_emacs_setsrc(char *option)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
wr_winget_getsrc (char *option)
|
||||||
|
{
|
||||||
|
chsrc_run ("winget source list");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
wr_winget_setsrc (char *option)
|
||||||
|
{
|
||||||
|
int index = use_specific_mirror_or_auto_select (option, wr_winget);
|
||||||
|
|
||||||
|
SourceInfo source = wr_winget_sources[index];
|
||||||
|
chsrc_say_selection (&source);
|
||||||
|
|
||||||
|
chsrc_run ("winget source remove winget");
|
||||||
|
chsrc_run (xy_2strjoin ("winget source add winget ", source.url));
|
||||||
|
|
||||||
|
chsrc_say_thanks (&source);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wr_brew_getsrc (char *option)
|
wr_brew_getsrc (char *option)
|
||||||
@ -2062,7 +2082,7 @@ static const char
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
def_target(wr_brew); def_target(wr_tex);
|
def_target(wr_winget); def_target(wr_brew); def_target(wr_tex);
|
||||||
TargetInfo
|
TargetInfo
|
||||||
wr_flathub_target = {wr_flathub_setsrc, NULL, wr_flathub_sources, wr_flathub_sources_n},
|
wr_flathub_target = {wr_flathub_setsrc, NULL, wr_flathub_sources, wr_flathub_sources_n},
|
||||||
wr_nix_target = {wr_nix_setsrc, NULL, wr_nix_sources, wr_nix_sources_n},
|
wr_nix_target = {wr_nix_setsrc, NULL, wr_nix_sources, wr_nix_sources_n},
|
||||||
@ -2071,6 +2091,7 @@ TargetInfo
|
|||||||
wr_anaconda_target = {wr_anaconda_setsrc, NULL, wr_anaconda_sources, wr_anaconda_sources_n};
|
wr_anaconda_target = {wr_anaconda_setsrc, NULL, wr_anaconda_sources, wr_anaconda_sources_n};
|
||||||
|
|
||||||
static const char
|
static const char
|
||||||
|
*wr_winget [] = {"winget", NULL, t(&wr_winget_target)},
|
||||||
*wr_brew [] = {"brew", "homebrew", NULL, t(&wr_brew_target)},
|
*wr_brew [] = {"brew", "homebrew", NULL, t(&wr_brew_target)},
|
||||||
*wr_flathub [] = {"flathub", NULL, t(&wr_flathub_target)},
|
*wr_flathub [] = {"flathub", NULL, t(&wr_flathub_target)},
|
||||||
*wr_nix [] = {"nix", NULL, t(&wr_nix_target)},
|
*wr_nix [] = {"nix", NULL, t(&wr_nix_target)},
|
||||||
@ -2080,7 +2101,7 @@ static const char
|
|||||||
*wr_anaconda[] = {"conda", "anaconda", NULL, t(&wr_anaconda_target)},
|
*wr_anaconda[] = {"conda", "anaconda", NULL, t(&wr_anaconda_target)},
|
||||||
**wr_softwares[] =
|
**wr_softwares[] =
|
||||||
{
|
{
|
||||||
wr_brew, wr_flathub, wr_nix, wr_guix, wr_emacs, wr_tex, wr_anaconda
|
wr_winget, wr_brew, wr_flathub, wr_nix, wr_guix, wr_emacs, wr_tex, wr_anaconda
|
||||||
};
|
};
|
||||||
#undef t
|
#undef t
|
||||||
/************************************** End Target Matrix ****************************************/
|
/************************************** End Target Matrix ****************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user