mirror of
https://github.com/aljazceru/Auditor.git
synced 2025-12-17 03:24:18 +01:00
Critical bug in aud init.
Fix: Create .pf directory before writing files in indexer Commit Description: Fixed critical bug where `aud init` would fail on clean projects with: "Failed to write manifest: [Errno 2] No such file or directory" Cause: - The indexer tried to write to .pf/manifest.json without creating parent directory - `aud init` calls indexer directly, which had no directory creation logic - `aud full` worked because pipelines.py creates .pf/ before calling indexer Effect: - Users running `aud init` on fresh projects would get immediate failure - Only affected first-time users following README instructions - Did not affect `aud full` users or existing projects with .pf/ directory Solution: - Added Path().parent.mkdir(parents=True, exist_ok=True) before writing manifest - Added same logic before creating database file - Ensures .pf directory structure is created regardless of entry point This fix ensures both `aud init` and `aud full` work on clean projects.
This commit is contained in:
@@ -266,6 +266,8 @@ def build_index(
|
||||
|
||||
# Write manifest
|
||||
try:
|
||||
# Ensure parent directory exists before writing
|
||||
Path(manifest_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(manifest_path, "w", encoding="utf-8") as f:
|
||||
json.dump(files, f, indent=2, sort_keys=True)
|
||||
except Exception as e:
|
||||
@@ -273,6 +275,9 @@ def build_index(
|
||||
|
||||
# Create and populate database
|
||||
try:
|
||||
# Ensure parent directory exists for database
|
||||
Path(db_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Check if database already exists
|
||||
db_exists = Path(db_path).exists()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user