Skip to content

Commit 8c86211

Browse files
author
Zhe Yu
committed
fix(cli): Copy global config.json5 during init
1 parent f9ba90d commit 8c86211

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/vectorcode/subcommands/init.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ async def init(configs: Config) -> int:
102102
is_initialised = 1
103103
else:
104104
os.makedirs(project_config_dir, exist_ok=True)
105-
for item in ("config.json", "vectorcode.include", "vectorcode.exclude"):
105+
for item in (
106+
"config.json5",
107+
"config.json",
108+
"vectorcode.include",
109+
"vectorcode.exclude",
110+
):
106111
local_file_path = os.path.join(project_config_dir, item)
107112
global_file_path = os.path.join(
108113
os.path.expanduser("~"), ".config", "vectorcode", item

tests/subcommands/test_init.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ async def test_init_copies_global_config(capsys):
6060
# Create mock global config files
6161
config_items = {
6262
"config.json": '{"test": "value"}',
63+
"config.json5": '{"test": "value"}',
6364
"vectorcode.include": "*.py",
6465
"vectorcode.exclude": "*/tests/*",
6566
}

0 commit comments

Comments
 (0)