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>
10 lines
393 B
Python
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()
|