mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-11-25 09:00:41 +08:00
Split winget out
This commit is contained in:
parent
66b2d36c39
commit
bbfb6d5401
|
@ -153,21 +153,10 @@ pl_dotnet_sources[] = {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* @time 2024-06-07 更新
|
||||
* @note 目前仅有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
wr_winget_sources[] = {
|
||||
{&Upstream, "https://cdn.winget.microsoft.com/cache"},
|
||||
{&Ustc, "https://mirrors.ustc.edu.cn/winget-source"},
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @time 2024-06-08 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
wr_cocoapods_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git"},
|
||||
|
@ -248,8 +237,6 @@ wr_tex_sources[] = {
|
|||
def_sources_n(pl_clojure);
|
||||
def_sources_n(pl_dotnet);
|
||||
|
||||
|
||||
def_sources_n(wr_winget);
|
||||
def_sources_n(wr_cocoapods);
|
||||
|
||||
def_sources_n(wr_flathub);
|
||||
|
|
31
src/chsrc.c
31
src/chsrc.c
|
@ -177,36 +177,7 @@ wr_tex_setsrc (char *option)
|
|||
|
||||
|
||||
#include "recipe/ware/emacs.c"
|
||||
|
||||
|
||||
void
|
||||
wr_winget_getsrc (char *option)
|
||||
{
|
||||
chsrc_run ("winget source list", RunOpt_Default);
|
||||
}
|
||||
|
||||
/* 参考:https://mirrors.ustc.edu.cn/help/winget-source.html */
|
||||
void
|
||||
wr_winget_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (wr_winget);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
chsrc_run ("winget source remove winget", RunOpt_Default);
|
||||
chsrc_run (xy_2strjoin ("winget source add winget ", source.url), RunOpt_Default);
|
||||
|
||||
chsrc_say_lastly (&source, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
void
|
||||
wr_winget_resetsrc (char *option)
|
||||
{
|
||||
chsrc_run ("winget source reset winget", RunOpt_Default);
|
||||
chsrc_say_lastly (NULL, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
|
||||
#include "recipe/ware/WinGet.c"
|
||||
#include "recipe/ware/Homebrew.c"
|
||||
|
||||
/**
|
||||
|
|
|
@ -92,7 +92,6 @@ static const char
|
|||
};
|
||||
|
||||
|
||||
def_target_full(wr_winget);
|
||||
def_target_noget (wr_cocoapods);
|
||||
def_target_noget (wr_flathub);
|
||||
def_target_noget (wr_nix);
|
||||
|
|
49
src/recipe/ware/WinGet.c
Normal file
49
src/recipe/ware/WinGet.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : Nil Null <nil@null.org>
|
||||
* Created On : <2024-06-07>
|
||||
* Last Modified : <2024-08-15>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @time 2024-06-07 更新
|
||||
* @note 目前仅有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
wr_winget_sources[] = {
|
||||
{&Upstream, "https://cdn.winget.microsoft.com/cache"},
|
||||
{&Ustc, "https://mirrors.ustc.edu.cn/winget-source"},
|
||||
};
|
||||
def_sources_n(wr_winget);
|
||||
|
||||
|
||||
void
|
||||
wr_winget_getsrc (char *option)
|
||||
{
|
||||
chsrc_run ("winget source list", RunOpt_Default);
|
||||
}
|
||||
|
||||
/* 参考:https://mirrors.ustc.edu.cn/help/winget-source.html */
|
||||
void
|
||||
wr_winget_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (wr_winget);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
chsrc_run ("winget source remove winget", RunOpt_Default);
|
||||
chsrc_run (xy_2strjoin ("winget source add winget ", source.url), RunOpt_Default);
|
||||
|
||||
chsrc_say_lastly (&source, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
void
|
||||
wr_winget_resetsrc (char *option)
|
||||
{
|
||||
chsrc_run ("winget source reset winget", RunOpt_Default);
|
||||
chsrc_say_lastly (NULL, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
def_target_full(wr_winget);
|
Loading…
Reference in New Issue
Block a user