fix default config loading
This commit is contained in:
@@ -43,6 +43,15 @@ def _find_data_dir(explicit: Optional[str], config_path: Optional[str]) -> Path:
|
|||||||
if out:
|
if out:
|
||||||
return Path(out).expanduser().resolve()
|
return Path(out).expanduser().resolve()
|
||||||
|
|
||||||
|
# Auto-detect: try extract_config.yaml in cwd
|
||||||
|
auto_config = Path.cwd() / "extract_config.yaml"
|
||||||
|
if auto_config.exists():
|
||||||
|
import yaml
|
||||||
|
raw = yaml.safe_load(auto_config.read_text())
|
||||||
|
out = raw.get("output", {}).get("dir")
|
||||||
|
if out:
|
||||||
|
return Path(out).expanduser().resolve()
|
||||||
|
|
||||||
# Default: ./bincio_data next to cwd
|
# Default: ./bincio_data next to cwd
|
||||||
default = Path.cwd() / "bincio_data"
|
default = Path.cwd() / "bincio_data"
|
||||||
if default.exists():
|
if default.exists():
|
||||||
|
|||||||
Reference in New Issue
Block a user