mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
libretiny: treat already-patched .ld as success on incremental rebuilds
The idempotency check in _inject_keep returns content unchanged when the marker is already present, so patched stayed 0 and the fail-hard RuntimeError fired on every incremental rebuild after the first. Check for the marker before attempting to patch and count it as success.
This commit is contained in:
@@ -86,6 +86,9 @@ def _pre_link(target, source, env):
|
||||
path = os.path.join(build_dir, name)
|
||||
with open(path, "r", encoding="utf-8") as fh:
|
||||
original = fh.read()
|
||||
if _MARKER in original:
|
||||
patched += 1
|
||||
continue
|
||||
content = original
|
||||
for fn in _patchers:
|
||||
content = fn(content)
|
||||
|
||||
Reference in New Issue
Block a user