mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-07 14:58:56 +00:00
Automate script checksum handling
This commit is contained in:
@@ -7,7 +7,7 @@ SRC_DIR = PROJECT_ROOT / "src"
|
||||
if str(SRC_DIR) not in sys.path:
|
||||
sys.path.insert(0, str(SRC_DIR))
|
||||
|
||||
from utils.checksum import calculate_checksum
|
||||
from utils.checksum import update_checksum_file
|
||||
from constants import SCRIPT_CHECKSUM_FILE, initialize_app
|
||||
|
||||
|
||||
@@ -15,11 +15,8 @@ def main() -> None:
|
||||
"""Calculate checksum for the main script and write it to SCRIPT_CHECKSUM_FILE."""
|
||||
initialize_app()
|
||||
script_path = SRC_DIR / "password_manager" / "manager.py"
|
||||
checksum = calculate_checksum(str(script_path))
|
||||
if checksum is None:
|
||||
raise SystemExit(f"Failed to calculate checksum for {script_path}")
|
||||
|
||||
SCRIPT_CHECKSUM_FILE.write_text(checksum)
|
||||
if not update_checksum_file(str(script_path), str(SCRIPT_CHECKSUM_FILE)):
|
||||
raise SystemExit(f"Failed to update checksum for {script_path}")
|
||||
print(f"Updated checksum written to {SCRIPT_CHECKSUM_FILE}")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user