Skip to content

Commit ea33e61

Browse files
committed
fix: use shell to run cmd
1 parent 2b4c3f5 commit ea33e61

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Diff for: index.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def gen_index(lang: str, directory: str, index_command: str):
1212

1313
if index_command:
1414
logger.info(f"custom index command: {index_command}")
15-
check_call(index_command.split(" "))
15+
check_call(index_command)
1616
return
1717

1818
if lang == "golang":
@@ -41,7 +41,7 @@ def gen_java_and_kotlin_index():
4141
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk"
4242

4343
# https://sourcegraph.github.io/scip-java/docs/getting-started.html#run-scip-java-index
44-
check_call(["scip-java", "index", "--output", "index.scip"])
44+
check_call(["scip-java index --output index.scip"])
4545

4646

4747
def gen_py_index():

Diff for: utils.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import os
22
import subprocess
3+
import typing
4+
35
from loguru import logger
46

57

6-
def check_call(commands: list):
8+
def check_call(commands: typing.Union[str, list]):
79
logger.info(f"check calling: {commands}")
8-
subprocess.check_call(commands, env=os.environ)
10+
if isinstance(commands, str):
11+
subprocess.check_call(commands, env=os.environ, shell=True)
12+
else:
13+
subprocess.check_call(commands, env=os.environ)

0 commit comments

Comments
 (0)