mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-02 14:10:45 +08:00
Add support for flutter
Gitee close #I802EV
This commit is contained in:
parent
e6d9652dd2
commit
ddec0a611f
28
chsrc.c
28
chsrc.c
|
@ -792,26 +792,30 @@ pl_dart_setsrc (char* option)
|
||||||
|
|
||||||
char* cmd = NULL;
|
char* cmd = NULL;
|
||||||
|
|
||||||
|
char* pub = xy_2strjoin(source.url, "dart-pub");
|
||||||
|
char* flutter = xy_2strjoin(source.url, "flutter");
|
||||||
|
|
||||||
if (xy_on_windows)
|
if (xy_on_windows)
|
||||||
{
|
{
|
||||||
if (xy_file_exist(xy_win_powershell_profile)) {
|
if (xy_file_exist(xy_win_powershell_profile))
|
||||||
chsrc_runcmd(
|
{
|
||||||
xy_strjoin(4, "echo $env:PUB_HOSTED_URL = \"", source.url, "\" >> ", xy_win_powershell_profile));
|
chsrc_runcmd(xy_strjoin(4, "echo $env:PUB_HOSTED_URL = \"", pub, "\" >> ", xy_win_powershell_profile));
|
||||||
|
chsrc_runcmd(xy_strjoin(4, "echo $env:FLUTTER_STORAGE_BASE_URL = \"", flutter, "\" >> ", xy_win_powershell_profile));
|
||||||
}
|
}
|
||||||
if (xy_file_exist(xy_win_powershellv5_profile)) {
|
|
||||||
chsrc_runcmd(
|
if (xy_file_exist(xy_win_powershellv5_profile))
|
||||||
xy_strjoin(4, "echo $env:PUB_HOSTED_URL = \"", source.url, "\" >> ", xy_win_powershellv5_profile));
|
{
|
||||||
|
chsrc_runcmd(xy_strjoin(4, "echo $env:PUB_HOSTED_URL = \"", pub, "\" >> ", xy_win_powershellv5_profile));
|
||||||
|
chsrc_runcmd(xy_strjoin(4, "echo $env:FLUTTER_STORAGE_BASE_URL = \"", flutter, "\" >> ", xy_win_powershell_profile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmd = "echo 'export PUB_HOSTED_URL=\"", source.url, "\"' >> ~/.bashrc";
|
cmd = "echo 'export PUB_HOSTED_URL=\"", pub, "\"' >> ~/.bashrc >> ~/.zshrc";
|
||||||
|
chsrc_runcmd(cmd);
|
||||||
|
cmd = "export 'FLUTTER_STORAGE_BASE_URL=\"", flutter, "\"' >> ~/.bashrc >> ~/.zshrc";
|
||||||
chsrc_runcmd(cmd);
|
chsrc_runcmd(cmd);
|
||||||
|
|
||||||
if (xy_file_exist("~/.zshrc")) {
|
|
||||||
cmd = "echo 'export PUB_HOSTED_URL=\"", source.url, "\"' >> ~/.zshrc";
|
|
||||||
chsrc_runcmd(cmd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chsrc_say_thanks(&source);
|
chsrc_say_thanks(&source);
|
||||||
}
|
}
|
||||||
|
|
14
chsrc.h
14
chsrc.h
|
@ -272,12 +272,18 @@ pl_dotnet_sources[] = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2023-09-10 更新
|
* 2023-09-10 更新
|
||||||
|
*
|
||||||
|
* @note 我们这里挑选的必须也支持 Flutter
|
||||||
|
*
|
||||||
|
* 我们将会在setsrc函数中生成
|
||||||
|
* 1. https://mirrors.tuna.tsinghua.edu.cn/dart-pub
|
||||||
|
* 2. https://mirrors.tuna.tsinghua.edu.cn/flutter
|
||||||
*/
|
*/
|
||||||
pl_dart_sources[] = {
|
pl_dart_sources[] = {
|
||||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/dart-pub"},
|
// {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/"}, // 不确定SJTUG的flutter镜像给的对不对
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/dart-pub"},
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/"},
|
||||||
{&Tencent, "https://mirrors.cloud.tencent.com/dart-pub/"},
|
{&Tencent, "https://mirrors.cloud.tencent.com/"},
|
||||||
{&Nju, "https://mirror.nju.edu.cn/dart-pub"},
|
{&Nju, "https://mirror.nju.edu.cn/"}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user