always copy custom bunfig
This commit is contained in:
parent
0876df7698
commit
1749e50f9a
@ -621,19 +621,13 @@ def initialize_bun_config():
|
|||||||
bun_config_path = get_web_dir() / constants.Bun.CONFIG_PATH
|
bun_config_path = get_web_dir() / constants.Bun.CONFIG_PATH
|
||||||
|
|
||||||
if (custom_bunfig := Path(constants.Bun.CONFIG_PATH)).exists():
|
if (custom_bunfig := Path(constants.Bun.CONFIG_PATH)).exists():
|
||||||
custom_bunfig_content = custom_bunfig.read_text()
|
bunfig_content = custom_bunfig.read_text()
|
||||||
if "registry =" in custom_bunfig_content:
|
console.info(f"Copying custom bunfig.toml inside {get_web_dir()} folder")
|
||||||
bun_config_path.write_text(custom_bunfig_content)
|
else:
|
||||||
return
|
best_registry = _get_npm_registry()
|
||||||
else:
|
bunfig_content = constants.Bun.DEFAULT_CONFIG.format(registry=best_registry)
|
||||||
console.error(
|
|
||||||
"The custom bunfig.toml file is invalid. Using default value."
|
|
||||||
)
|
|
||||||
|
|
||||||
best_registry = _get_npm_registry()
|
bun_config_path.write_text(bunfig_content)
|
||||||
bun_config_path.write_text(
|
|
||||||
constants.Bun.DEFAULT_CONFIG.format(registry=best_registry)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def init_reflex_json(project_hash: int | None):
|
def init_reflex_json(project_hash: int | None):
|
||||||
|
Loading…
Reference in New Issue
Block a user