Skip to content

Commit 70fee29

Browse files
authored
Merge pull request #17 from AbduAzim424/shellcheck-hook-arch
shellcheck_run_steps.py: read arch from pkg YAML
2 parents beb7441 + 64740cd commit 70fee29

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pre_commit_hooks/shellcheck_run_steps.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def main(argv: Sequence[str] | None = None) -> int:
109109
"w",
110110
delete_on_close=False,
111111
) as compiled_out:
112+
with open(filename) as precompiled_in:
113+
melange_cfg = yaml.load(precompiled_in)
114+
arch = melange_cfg["package"].get("target-architecture", ["x86_64"])[0]
112115
subprocess.check_call(
113116
[
114117
"docker",
@@ -117,7 +120,7 @@ def main(argv: Sequence[str] | None = None) -> int:
117120
"--rm",
118121
MelangeImage,
119122
"compile",
120-
f"--arch={os.uname().machine}",
123+
f"--arch={arch}",
121124
"--pipeline-dir=./pipelines",
122125
filename,
123126
],

0 commit comments

Comments
 (0)