diff --git a/src/framework/chef.c b/src/framework/chef.c index 0095de9..c56f19a 100644 --- a/src/framework/chef.c +++ b/src/framework/chef.c @@ -51,19 +51,15 @@ chef_allow_local_mode (Target_t *target, Capability_t cap, const char *explain_z return; } + if (cap == CanNot) + { + target->cap_local_explain = xy_strdup (CHINESE ? "无法进行项目级换源" : "Unable to perform project-level source switching"); + return; + } + target->cap_local_explain = xy_strdup (CHINESE ? explain_zh : explain_en); } -void -chef_forbid_local_mode (Target_t *target) -{ - if (!target) - return; - - target->cap_local = CanNot; - target->cap_local_explain = xy_strdup (CHINESE ? "无法进行项目级换源" : "Unable to perform project-level source switching"); -} - void chef_allow_user_define (Target_t *target) diff --git a/src/recipe/lang/Dart/Flutter.c b/src/recipe/lang/Dart/Flutter.c index b13e61d..d2e6481 100644 --- a/src/recipe/lang/Dart/Flutter.c +++ b/src/recipe/lang/Dart/Flutter.c @@ -21,7 +21,7 @@ pl_dart_flutter_prelude (void) "czyt", "czyt.go@gmail.com", "MadDogOwner", "xiaoran@xrgzs.top"); - chef_forbid_local_mode (this); + chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/JavaScript/common.h b/src/recipe/lang/JavaScript/common.h index aba3608..a024677 100644 --- a/src/recipe/lang/JavaScript/common.h +++ b/src/recipe/lang/JavaScript/common.h @@ -62,7 +62,7 @@ pl_js_nodejs_binary_prelude (void) chef_set_cooks (this, 0); chef_set_contributors (this, 0); - chef_forbid_local_mode (this); + chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/JavaScript/nvm.c b/src/recipe/lang/JavaScript/nvm.c index 92401ca..6a81141 100644 --- a/src/recipe/lang/JavaScript/nvm.c +++ b/src/recipe/lang/JavaScript/nvm.c @@ -19,7 +19,7 @@ pl_js_nvm_prelude (void) chef_set_cooks (this, 0); chef_set_contributors (this, 0); - chef_forbid_local_mode (this); + chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/Python/pip.c b/src/recipe/lang/Python/pip.c index f36f567..1a2dc41 100644 --- a/src/recipe/lang/Python/pip.c +++ b/src/recipe/lang/Python/pip.c @@ -19,7 +19,7 @@ pl_python_pip_prelude (void) chef_set_cooks (this, 0); chef_set_contributors (this, 0); - chef_forbid_local_mode (this); + chef_allow_local_mode (this, CanNot, NULL, NULL); chef_allow_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/Rust/rustup.c b/src/recipe/lang/Rust/rustup.c index a5d9422..67ccb10 100644 --- a/src/recipe/lang/Rust/rustup.c +++ b/src/recipe/lang/Rust/rustup.c @@ -24,7 +24,7 @@ pl_rust_rustup_prelude (void) "Yangmoooo", "yangmoooo@outlook.com", "Mikachu2333", "mikachu.23333@zohomail.com"); - chef_forbid_local_mode (this); + chef_allow_local_mode (this, CanNot, NULL, NULL); chef_forbid_english (this); chef_allow_user_define(this);