Skip to content

Commit 0c10b1b

Browse files
committed
Show different location based on -local for Bun
1 parent 60e611e commit 0c10b1b

File tree

1 file changed

+12
-2
lines changed
  • src/recipe/lang/Node.js

1 file changed

+12
-2
lines changed

src/recipe/lang/Node.js/Bun.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,31 @@ pl_nodejs_bun_getsrc (char *option)
2020
/**
2121
* @consult https://bun.sh/docs/runtime/bunfig#global-vs-local
2222
* @consult https://github.com/RubyMetric/chsrc/issues/83
23+
* @consult https://github.com/RubyMetric/chsrc/pull/90
2324
*
2425
* chsrc set bun
2526
*/
2627
void
2728
pl_nodejs_bun_setsrc (char *option)
2829
{
2930
char *setsrc_type = xy_streql (option, SetsrcType_Reset) ? SetsrcType_Reset : SetsrcType_Manual;
31+
32+
// 用的是 npm Registry 的源
3033
chsrc_yield_source (pl_nodejs);
3134

3235
char *file = xy_strjoin(3, "[install]\n"
3336
"registry = \"", source.url, "\"");
3437

35-
chsrc_note2 (xy_strjoin (3, "(全局配置)请您手动写入以下内容到 ", xy_uniform_path ("~/.bunfig.toml"), " 文件中(如果只是配置项目级,则写入到项目根目录的 bunfig.toml 文件中。):"));
36-
puts (file);
38+
if (CliOpt_Locally==true)
39+
{
40+
chsrc_note2 ("请您手动写入以下内容到本项目根目录的 bunfig.toml 文件中");
41+
}
42+
else
43+
{
44+
chsrc_note2 (xy_strjoin (3, "请您手动写入以下内容到 ", xy_uniform_path ("~/.bunfig.toml"), " 文件中"));
45+
}
3746

47+
puts (file);
3848
chsrc_conclude (&source, setsrc_type);
3949
}
4050

0 commit comments

Comments
 (0)