diff --git a/include/source.h b/include/source.h index 25d4087..e74407f 100644 --- a/include/source.h +++ b/include/source.h @@ -153,22 +153,12 @@ pl_dotnet_sources[] = { -/** - * @time 2024-06-08 更新 - */ -static SourceInfo -wr_cocoapods_sources[] = { - {&Upstream, NULL}, - {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git"}, - {&Bfsu, "https://mirrors.bfsu.edu.cn/git/CocoaPods/Specs.git"} -}, - - /** * @time 2023-09-11 更新 * @note 目前只有一个源 */ +static SourceInfo wr_flathub_sources[] = { {&Upstream, NULL}, {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/flathub"}, @@ -237,8 +227,6 @@ wr_tex_sources[] = { def_sources_n(pl_clojure); def_sources_n(pl_dotnet); -def_sources_n(wr_cocoapods); - def_sources_n(wr_flathub); def_sources_n(wr_nix); def_sources_n(wr_guix); def_sources_n(wr_tex); diff --git a/src/chsrc.c b/src/chsrc.c index b4d9ef4..48ef3bc 100644 --- a/src/chsrc.c +++ b/src/chsrc.c @@ -179,32 +179,7 @@ wr_tex_setsrc (char *option) #include "recipe/ware/emacs.c" #include "recipe/ware/WinGet.c" #include "recipe/ware/Homebrew.c" - -/** - * 参考:https://mirrors.tuna.tsinghua.edu.cn/help/CocoaPods/ - */ -void -wr_cocoapods_setsrc (char *option) -{ - SourceInfo source; - chsrc_yield_source (wr_cocoapods); - chsrc_confirm_source (&source); - - chsrc_note2 ("请手动执行以下命令:"); - - say ("cd ~/.cocoapods/repos"); - say ("pod repo remove master"); - char *git_cmd = xy_strjoin (3, "git clone ", source.url, " master"); - say (git_cmd); - say (""); - - chsrc_note2 ("最后进入项目工程目录,在Podfile中第一行加入:"); - char *source_str = xy_strjoin (3, "source '", source.url, "'"); - say (source_str); - - chsrc_say_lastly (&source, ChsrcTypeManual); -} - +#include "recipe/ware/CocoaPods.c" /** diff --git a/src/recipe/catalog.c b/src/recipe/catalog.c index 6b51e06..9699fde 100644 --- a/src/recipe/catalog.c +++ b/src/recipe/catalog.c @@ -92,7 +92,6 @@ static const char }; -def_target_noget (wr_cocoapods); def_target_noget (wr_flathub); def_target_noget (wr_nix); def_target_noget (wr_guix); diff --git a/src/recipe/ware/CocoaPods.c b/src/recipe/ware/CocoaPods.c new file mode 100644 index 0000000..69aaee9 --- /dev/null +++ b/src/recipe/ware/CocoaPods.c @@ -0,0 +1,46 @@ +/** ------------------------------------------------------------ + * SPDX-License-Identifier: GPL-3.0-or-later + * ------------------------------------------------------------- + * File Authors : Aoran Zeng + * Contributors : Nil Null + * Created On : <2024-06-08> + * Last Modified : <2024-08-15> + * ------------------------------------------------------------*/ + +/** + * @time 2024-06-08 更新 + */ +static SourceInfo +wr_cocoapods_sources[] = { + {&Upstream, NULL}, + {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git"}, + {&Bfsu, "https://mirrors.bfsu.edu.cn/git/CocoaPods/Specs.git"} +}; +def_sources_n(wr_cocoapods); + +/** + * 参考:https://mirrors.tuna.tsinghua.edu.cn/help/CocoaPods/ + */ +void +wr_cocoapods_setsrc (char *option) +{ + SourceInfo source; + chsrc_yield_source (wr_cocoapods); + chsrc_confirm_source (&source); + + chsrc_note2 ("请手动执行以下命令:"); + + say ("cd ~/.cocoapods/repos"); + say ("pod repo remove master"); + char *git_cmd = xy_strjoin (3, "git clone ", source.url, " master"); + say (git_cmd); + say (""); + + chsrc_note2 ("最后进入项目工程目录,在Podfile中第一行加入:"); + char *source_str = xy_strjoin (3, "source '", source.url, "'"); + say (source_str); + + chsrc_say_lastly (&source, ChsrcTypeManual); +} + +def_target_noget (wr_cocoapods);