mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-28 13:57:43 +00:00
fix(env): keep shellcheck and the cache-read lint green on the distro switch
The loader copies INFINITO_DISTRO into a loader-local variable before it compares the value with the one in .env. With INFINITO_DISTRO read directly in that condition, `shellcheck -x scripts/meta/resolve/apps.sh` reported SC2153 for INFINITO_DISTROS, which apps.sh takes from the sourced .env; with the copy it reports nothing, as on main. The loader test checks that .env is unchanged with filecmp against the file it was copied from, instead of reading it twice with Path.read_bytes, which test_no_uncached_file_reads rejects. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1079f48feb
commit
1d970fe5bd
2 files changed
+11
-5
No files matched your search
+8
-3
@@ -8,6 +8,7 @@ stay as it was.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import filecmp
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -93,9 +94,13 @@ class TestDistroDerivedKeys(unittest.TestCase):
|
||||
shutil.copy(LOADER_DIR / name, checkout / "scripts" / "meta" / "env")
|
||||
dotenv = checkout / ".env"
|
||||
shutil.copy(self.scratch / "debian.env", dotenv)
|
||||
before = dotenv.read_bytes()
|
||||
shown = bash(f"load() {{ source scripts/meta/env/load.sh; }}\n{steps}", checkout)
|
||||
self.assertEqual(dotenv.read_bytes(), before, ".env was rewritten")
|
||||
shown = bash(
|
||||
f"load() {{ source scripts/meta/env/load.sh; }}\n{steps}", checkout
|
||||
)
|
||||
self.assertTrue(
|
||||
filecmp.cmp(dotenv, self.scratch / "debian.env", shallow=False),
|
||||
".env was rewritten",
|
||||
)
|
||||
return shown
|
||||
|
||||
def test_the_two_distros_derive_different_keys(self):
|
||||
|
||||
Reference in new issue
Block a user