10000 refactor(cmd): reimplement how cmd is run · Lee-W/commitizen@b4f42f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4f42f2

Browse files
committed
refactor(cmd): reimplement how cmd is run
In the original design, command to long will not be run. I use the code how invoke runs sunbprocess. https://github.com/pyinvoke/invoke/blob/master/invoke/runners.py#L1271
1 parent efc1bdb commit b4f42f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

commitizen/cmd.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ class Command(NamedTuple):
1010

1111

1212
def run(cmd: str) -> Command:
13-
cmd.split()
1413
process = subprocess.Popen(
15-
cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE
14+
cmd,
15+
shell=True,
16+
stdout=subprocess.PIPE,
17+
stderr=subprocess.PIPE,
18+
stdin=subprocess.PIPE,
1619
)
1720
stdout, stderr = process.communicate()
1821
return Command(stdout.decode(), stderr.decode(), stdout, stderr)

0 commit comments

Comments
 (0)
0