3333# * * * * * * * * * * * * * * * * * * * * *
3434import subprocess
3535import sys
36+ from functools import cache
3637
3738from typing_extensions import Annotated
3839
@@ -61,6 +62,7 @@ def ensure_deps():
6162
6263import signal
6364from datetime import datetime
65+ import typeguard
6466from watchdog .observers import Observer
6567from watchdog .events import FileSystemEventHandler
6668
@@ -69,7 +71,7 @@ def ensure_deps():
6971FIREFOX_DIR = Path .home () / ".mozilla" / "firefox" # Linux/macOS
7072PROFILES_INI = FIREFOX_DIR / "profiles.ini"
7173BACKUP_DIR = Path .home () / "firefox-profile-backups"
72-
74+ typeguard . install_import_hook ( 'ffpm' )
7375
7476def get_profile_path (profile_name_or_path : str ) -> Path :
7577 path = Path (profile_name_or_path ).expanduser ().resolve ()
@@ -324,11 +326,30 @@ def watch(profile_name: str = typer.Argument(...), out: str = "watch-log.csv"):
324326
325327def _ensureBakDir ():
326328 import os
327- os .makedirs (BACKUP_DIR )
328-
329+ if not BACKUP_DIR .exists ():
330+ os .makedirs (BACKUP_DIR )
331+
332+
333+ def _logo (_ ):
334+ print ("""
335+ M\" \" \" \" \" \" \" \" `M dP
336+ Mmmmmm .M 88
337+ MMMMP .MMM dP dP 88 .dP .d8888b.
338+ MMP .MMMMM 88 88 88888" 88' `88
339+ M' .MMMMMMM 88. .88 88 `8b. 88. .88
340+ M M `88888P' dP `YP `88888P'
341+ MMMMMMMMMMM -*- Created by Zuko -*-
342+
343+ * * * * * * * * * * * * * * * * * * * * *
344+ * - - - F.R.E.E.M.I.N.D - - - *
345+ * - Copyright © 2025 (Z) Programing - *
346+ * - - All Rights Reserved - - *
347+ * * * * * * * * * * * * * * * * * * * * *
348+ """ )
329349
330350@app .command ()
331351def list ():
352+ """List available installed profiles"""
332353 profiles = get_profiles ()
333354 from rich .table import Table
334355 from rich .console import Console
@@ -361,6 +382,8 @@ def export_profile(name: str, output: Annotated[Path, typer.Argument()] = None):
361382 if not path or not path .exists ():
362383 typer .echo ("Profile not found." )
363384 raise typer .Exit (1 )
385+ if output .exists ():
386+ typer .confirm (f"Output file { str (output )} exists. Overwrite?" , abort = True )
364387 with zipfile .ZipFile (output , 'w' , zipfile .ZIP_DEFLATED ) as zipf :
365388 for root , _ , files in os .walk (path ):
366389 for file in files :
0 commit comments