Skip to content

Commit

Permalink
Implement reset for Go, Pub, Flutter
Browse files Browse the repository at this point in the history
[GitHub #111]
  • Loading branch information
ccmywish committed Oct 31, 2024
1 parent 3e2e7f9 commit 5b23eb0
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/chsrc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* chsrc: Change Source —— 全平台通用命令行换源工具
* ------------------------------------------------------------*/

#define Chsrc_Version "0.1.9.2"
#define Chsrc_Version "0.1.9.2-dev1"
#define Chsrc_Release_Date "2024/10/31"
#define Chsrc_Banner_Version "v" Chsrc_Version "-" Chsrc_Release_Date
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
Expand Down
11 changes: 9 additions & 2 deletions src/recipe/lang/Dart/Flutter.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ pl_dart_flutter_setsrc (char *option)
}


void
pl_dart_flutter_resetsrc (char *option)
{
pl_dart_flutter_setsrc (SetsrcType_Reset);
}


/**
* chsrc ls flutter
*/
Expand All @@ -96,7 +103,7 @@ pl_dart_flutter_feat (char *option)
FeatInfo f = {0};

f.can_get = true;
f.can_reset = false;
f.can_reset = true;

f.cap_locally = CanNot;
f.locally = NULL;
Expand All @@ -108,4 +115,4 @@ pl_dart_flutter_feat (char *option)
return f;
}

def_target_gsf(pl_dart_flutter);
def_target_gsrf(pl_dart_flutter);
11 changes: 9 additions & 2 deletions src/recipe/lang/Dart/Pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,20 @@ pl_dart_setsrc (char *option)
}


void
pl_dart_resetsrc (char *option)
{
pl_dart_setsrc (SetsrcType_Reset);
}


FeatInfo
pl_dart_feat (char *option)
{
FeatInfo f = {0};

f.can_get = true;
f.can_reset = false;
f.can_reset = true;

f.cap_locally = CanNot;
f.locally = NULL;
Expand All @@ -101,4 +108,4 @@ pl_dart_feat (char *option)
return f;
}

def_target_gsf(pl_dart);
def_target_gsrf(pl_dart);
31 changes: 30 additions & 1 deletion src/recipe/lang/Go.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,33 @@ pl_go_setsrc (char *option)
chsrc_conclude (&source, SetsrcType_Auto);
}

def_target(pl_go);

void
pl_go_resetsrc (char *option)
{
pl_go_setsrc (SetsrcType_Reset);
}


/**
* chsrc ls go
*/
FeatInfo
pl_go_feat (char *option)
{
FeatInfo f = {0};

f.can_get = true;
f.can_reset = true;

f.cap_locally = CanNot;
f.locally = NULL;
f.can_english = false;

f.can_user_define = true;

f.note = NULL;
return f;
}

def_target_gsrf(pl_go);
2 changes: 1 addition & 1 deletion src/recipe/lang/Ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pl_ruby_remove_gem_source (const char *source)
}

/**
* Ruby换源,参考:https://gitee.com/RubyMetric/rbenv-cn
* @consult https://gitee.com/RubyMetric/rbenv-cn
*/
void
pl_ruby_setsrc (char *option)
Expand Down

0 comments on commit 5b23eb0

Please sign in to comment.