Skip to content

Commit

Permalink
print copiable commands
Browse files Browse the repository at this point in the history
shlex.join handle adding ' when argument contains space. Before it was printed like this: `--extra-experimental-features nix-command no-url-literals`
  • Loading branch information
Et7f3 authored May 11, 2024
1 parent 737426c commit 842a59c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nixpkgs_review/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import functools
import os
import shlex
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -29,7 +30,7 @@ def wrapper(text: str) -> None:
def sh(
command: list[str], cwd: Path | str | None = None
) -> "subprocess.CompletedProcess[str]":
info("$ " + " ".join(command))
info("$ " + shlex.join(command))
return subprocess.run(command, cwd=cwd, text=True)


Expand Down

0 comments on commit 842a59c

Please sign in to comment.