fix: don't source _run_cmd on windows

This commit is contained in:
Daylin Morgan 2023-05-23 14:47:04 -05:00
parent f1077adc9f
commit 9044248896
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -1,4 +1,5 @@
import io import io
import platform
import sys import sys
import textwrap import textwrap
from argparse import SUPPRESS, FileType from argparse import SUPPRESS, FileType
@ -9,7 +10,6 @@ from rich.text import Text
from ._argparse import ArgumentParser from ._argparse import ArgumentParser
from ._export_format import CONSOLE_SVG_FORMAT from ._export_format import CONSOLE_SVG_FORMAT
from ._run_cmd import run_cmd
from ._version import __version__ from ._version import __version__
from .console import Console from .console import Console
from .term import term from .term import term
@ -101,6 +101,10 @@ def main() -> None:
elif args.cmd: elif args.cmd:
cmd = " ".join(args.cmd) cmd = " ".join(args.cmd)
if platform.system() == "windows":
term.print("[CmdError]: cmd mode is not supported on Windows", err=True)
sys.exit(1)
from ._run_cmd import run_cmd
try: try:
returncode, captured_output = run_cmd(cmd) returncode, captured_output = run_cmd(cmd)