bundlewrap/libs/local.py
CroneKorkN 730625e36c
libs/hooks/bin: add one-line module docstrings and # purpose: headers
every libs/*.py and hooks/*.py now starts with a one-line module
docstring; every bin/* script starts with a `# purpose:` header.
discovery-by-`ls`-and-read instead of by index.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 15:36:19 +02:00

10 lines
393 B
Python

"""local: identifier of the bw host itself (read from ~/.config/bundlewrap/local_id) — paired with hooks/skip_local_nodes.py."""
from os.path import expanduser, exists
from functools import cache
@cache
def id():
if exists(expanduser('~/.config/bundlewrap/local_id')):
with open(expanduser('~/.config/bundlewrap/local_id'), 'r') as file:
return file.read().strip()