diff --git a/src/recipe/lang/Dart/Flutter.c b/src/recipe/lang/Dart/Flutter.c index 84c34b3..2ec165a 100644 --- a/src/recipe/lang/Dart/Flutter.c +++ b/src/recipe/lang/Dart/Flutter.c @@ -3,10 +3,10 @@ * ------------------------------------------------------------- * File Authors : Aoran Zeng * Contributors : czyt - * | + * | * Created On : <2023-09-10> * Major Revision : 2 - * Last Modified : <2024-11-22> + * Last Modified : <2025-04-15> * * 2024-09-14: 不得不将Dart和Flutter拆分为两个Target, * 因为3家教育网镜像站给出的 Dart 和 Flutter 换源URL模式都不一样 @@ -57,16 +57,11 @@ pl_dart_flutter_setsrc (char *option) chsrc_yield_source_and_confirm (pl_dart_flutter); char *w = NULL; - + char *cmd = NULL; if (xy_on_windows) { - w = xy_strjoin (3, "$env:FLUTTER_STORAGE_BASE_URL = \"", source.url, "\"\n"); - - if (xy_file_exist (xy_win_powershell_profile)) - chsrc_append_to_file (w, xy_win_powershell_profile); - - if (xy_file_exist (xy_win_powershellv5_profile)) - chsrc_append_to_file (w, xy_win_powershellv5_profile); + cmd = xy_strjoin (3, "setx FLUTTER_STORAGE_BASE_URL \"", source.url, "\""); + chsrc_run (cmd, RunOpt_No_Last_New_Line); } else { diff --git a/src/recipe/lang/Dart/Pub.c b/src/recipe/lang/Dart/Pub.c index f12f708..ffb3ac3 100644 --- a/src/recipe/lang/Dart/Pub.c +++ b/src/recipe/lang/Dart/Pub.c @@ -3,10 +3,10 @@ * ------------------------------------------------------------- * File Authors : Aoran Zeng * Contributors : czyt - * | + * | * Created On : <2023-09-10> * Major Revision : 3 - * Last Modified : <2024-10-31> + * Last Modified : <2025-04-15> * * Dart Pub 软件仓库 * ------------------------------------------------------------*/ @@ -52,16 +52,11 @@ pl_dart_setsrc (char *option) chsrc_yield_source_and_confirm (pl_dart); char *w = NULL; - + char *cmd = NULL; if (xy_on_windows) { - w = xy_strjoin (3, "$env:PUB_HOSTED_URL = \"", source.url, "\"\n"); - - if (xy_file_exist (xy_win_powershell_profile)) - chsrc_append_to_file (w, xy_win_powershell_profile); - - if (xy_file_exist (xy_win_powershellv5_profile)) - chsrc_append_to_file (w, xy_win_powershellv5_profile); + cmd = xy_strjoin (3, "setx PUB_HOSTED_URL \"", source.url, "\""); + chsrc_run (cmd, RunOpt_No_Last_New_Line); } else {