Use setx in Windows for Dart

This commit is contained in:
MadDogOwner 2025-04-15 06:19:27 +08:00
parent 09fba2b888
commit 5398a5d3d1
No known key found for this signature in database
GPG Key ID: 0730AD911EB33562
2 changed files with 10 additions and 20 deletions

View File

@ -3,10 +3,10 @@
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : czyt <czyt.go@gmail.com>
* |
* |
* 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
{

View File

@ -3,10 +3,10 @@
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : czyt <czyt.go@gmail.com>
* |
* |
* 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
{