mirror of
https://github.com/SuperClaude-Org/SuperClaude_Framework.git
synced 2025-12-29 16:16:08 +00:00
Update backup.py
Signed-off-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
This commit is contained in:
@@ -487,6 +487,15 @@ def run(args: argparse.Namespace) -> int:
|
|||||||
operation = BackupOperation()
|
operation = BackupOperation()
|
||||||
operation.setup_operation_logging(args)
|
operation.setup_operation_logging(args)
|
||||||
logger = get_logger()
|
logger = get_logger()
|
||||||
|
# ✅ Inserted validation code
|
||||||
|
expected_home = Path.home().resolve()
|
||||||
|
actual_dir = args.install_dir.resolve()
|
||||||
|
|
||||||
|
if not str(actual_dir).startswith(str(expected_home)):
|
||||||
|
print(f"\n[✗] Installation must be inside your user profile directory.")
|
||||||
|
print(f" Expected prefix: {expected_home}")
|
||||||
|
print(f" Provided path: {actual_dir}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Validate global arguments
|
# Validate global arguments
|
||||||
@@ -576,4 +585,4 @@ def run(args: argparse.Namespace) -> int:
|
|||||||
print(f"\n{Colors.YELLOW}Backup operation cancelled by user{Colors.RESET}")
|
print(f"\n{Colors.YELLOW}Backup operation cancelled by user{Colors.RESET}")
|
||||||
return 130
|
return 130
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return operation.handle_operation_error("backup", e)
|
return operation.handle_operation_error("backup", e)
|
||||||
|
|||||||
Reference in New Issue
Block a user