Add Haskell cabal config via rawstr4c

This commit is contained in:
Aoran Zeng
2025-07-22 18:26:19 +08:00
parent 31f1f30c31
commit f6374fae9c
3 changed files with 26 additions and 14 deletions

View File

@@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* Created On : <2023-09-10>
* Last Modified : <2025-07-21>
* Last Modified : <2025-07-22>
* ------------------------------------------------------------*/
#include "rawstr4c.h"
@@ -33,13 +33,7 @@ pl_haskell_setsrc (char *option)
{
chsrc_yield_source_and_confirm (pl_haskell);
char *file = R"(
repository mirror
url: @url@
secure: True
)";
file = xy_str_gsub (file, "@url@", source.url);
char *content = xy_str_gsub (RAWSTR_pl_haskell_cabal_config, "@url@", source.url);
char *config = NULL;
if (xy_on_windows)
@@ -52,12 +46,12 @@ repository mirror
}
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
println (file);
print (content);
config = xy_normalize_path ("~/.stack/config.yaml");
file = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);
content = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
p (file);
print (content);
chsrc_determine_chgtype (ChgType_Manual);
chsrc_conclude (&source);