fix: add signal handling for graceful script termination
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 14s
Nix Format Check / check-format (push) Successful in 1m11s
Python Lint Check / check-python (push) Failing after 11s

This commit is contained in:
Menno van Leeuwen 2025-03-25 17:06:47 +01:00
parent 66e0253fdb
commit ab0e80ec86
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -1,9 +1,15 @@
#!/usr/bin/env python3
import os
import sys
import signal
import subprocess
from pathlib import Path
import sys
def signal_handler(sig, frame):
print('Exiting.')
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
# Script constants
DOTFILES_ROOT = os.path.expanduser("~/.dotfiles")