From 04656a718c383b6b67d828bea46af4e67016a87b Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 12 Dec 2024 21:37:17 +0800 Subject: [PATCH] fix: use shlex.join for command formatting in run function --- nix_update/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix_update/utils.py b/nix_update/utils.py index eab82e2..874e3f6 100644 --- a/nix_update/utils.py +++ b/nix_update/utils.py @@ -1,4 +1,5 @@ import os +import shlex import subprocess import sys from collections.abc import Callable @@ -31,7 +32,7 @@ def run( check: bool = True, extra_env: dict[str, str] = {}, ) -> "subprocess.CompletedProcess[str]": - info("$ " + " ".join(command)) + info("$ " + shlex.join(command)) env = os.environ.copy() env.update(extra_env) return subprocess.run(