Skip to content

Commit 52004a1

Browse files
committed
Remove chef_forbid_local_mode()
1 parent 492ca42 commit 52004a1

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

src/framework/chef.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,13 @@ chef_allow_local_mode (Target_t *target, Capability_t cap, const char *explain_z
5151
return;
5252
}
5353

54-
target->cap_local_explain = xy_strdup (CHINESE ? explain_zh : explain_en);
55-
}
56-
57-
void
58-
chef_forbid_local_mode (Target_t *target)
59-
{
60-
if (!target)
61-
return;
54+
if (cap == CanNot)
55+
{
56+
target->cap_local_explain = xy_strdup (CHINESE ? "无法进行项目级换源" : "Unable to perform project-level source switching");
57+
return;
58+
}
6259

63-
target->cap_local = CanNot;
64-
target->cap_local_explain = xy_strdup (CHINESE ? "无法进行项目级换源" : "Unable to perform project-level source switching");
60+
target->cap_local_explain = xy_strdup (CHINESE ? explain_zh : explain_en);
6561
}
6662

6763

src/recipe/lang/Dart/Flutter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pl_dart_flutter_prelude (void)
2121
"czyt", "[email protected]",
2222
"MadDogOwner", "[email protected]");
2323

24-
chef_forbid_local_mode (this);
24+
chef_allow_local_mode (this, CanNot, NULL, NULL);
2525
chef_allow_english(this);
2626
chef_allow_user_define(this);
2727

src/recipe/lang/JavaScript/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pl_js_nodejs_binary_prelude (void)
6262
chef_set_cooks (this, 0);
6363
chef_set_contributors (this, 0);
6464

65-
chef_forbid_local_mode (this);
65+
chef_allow_local_mode (this, CanNot, NULL, NULL);
6666
chef_allow_english(this);
6767
chef_allow_user_define(this);
6868

src/recipe/lang/JavaScript/nvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pl_js_nvm_prelude (void)
1919
chef_set_cooks (this, 0);
2020
chef_set_contributors (this, 0);
2121

22-
chef_forbid_local_mode (this);
22+
chef_allow_local_mode (this, CanNot, NULL, NULL);
2323
chef_allow_english(this);
2424
chef_allow_user_define(this);
2525

src/recipe/lang/Python/pip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pl_python_pip_prelude (void)
1919
chef_set_cooks (this, 0);
2020
chef_set_contributors (this, 0);
2121

22-
chef_forbid_local_mode (this);
22+
chef_allow_local_mode (this, CanNot, NULL, NULL);
2323
chef_allow_english(this);
2424
chef_allow_user_define(this);
2525

src/recipe/lang/Rust/rustup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pl_rust_rustup_prelude (void)
2424
"Yangmoooo", "[email protected]",
2525
"Mikachu2333", "[email protected]");
2626

27-
chef_forbid_local_mode (this);
27+
chef_allow_local_mode (this, CanNot, NULL, NULL);
2828
chef_forbid_english (this);
2929
chef_allow_user_define(this);
3030

0 commit comments

Comments
 (0)