Skip to content

Commit e874d0b

Browse files
authored
Merge pull request #1558 from stonebig/master
simplify further tools plumbery
2 parents f2a1af6 + 82616fc commit e874d0b

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

make.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ def _get_installed_tools_markdown(self) -> str:
133133
tool_lines = []
134134

135135
if (nodejs_path := self.winpython_directory / NODEJS_RELATIVE_PATH).exists():
136-
version = utils.get_nodejs_version(nodejs_path)
137-
tool_lines.append(f"[Nodejs](https://nodejs.org) | {version} | a JavaScript runtime built on Chrome's V8 JavaScript engine")
138-
version = utils.get_npmjs_version(nodejs_path)
136+
version = utils.exec_shell_cmd("node -v", nodejs_path).splitlines()[0]
137+
tool_lines.append(f"[Nodejs](https://nodejs.org) | {version} | xa JavaScript runtime built on Chrome's V8 JavaScript engine")
138+
version = utils.exec_shell_cmd("npm -v", nodejs_path).splitlines()[0]
139139
tool_lines.append(f"[npmjs](https://www.npmjs.com) | {version} | a package manager for JavaScript")
140140

141141
if (pandoc_exe := self.winpython_directory / "t" / "pandoc.exe").exists():
142-
version = utils.get_pandoc_version(str(pandoc_exe.parent))
142+
version = utils.exec_shell_cmd("pandoc -v", pandoc_exe.parent).splitlines()[0].split(" ")[-1]
143143
tool_lines.append(f"[Pandoc](https://pandoc.org) | {version} | an universal document converter")
144144

145145
if vscode_exe := (self.winpython_directory / "t" / "VSCode" / "Code.exe").exists():

winpython/utils.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,6 @@ def exec_run_cmd(args, path=None):
166166
process = subprocess.run(args, capture_output=True, cwd=path, text=True)
167167
return process.stdout
168168

169-
def get_nodejs_version(path):
170-
"""Return version of the Nodejs installed in *path*."""
171-
return exec_shell_cmd("node -v", path).splitlines()[0]
172-
173-
def get_npmjs_version(path):
174-
"""Return version of the Nodejs installed in *path*."""
175-
return exec_shell_cmd("npm -v", path).splitlines()[0]
176-
177-
def get_pandoc_version(path):
178-
"""Return version of the Pandoc executable in *path*."""
179-
return exec_shell_cmd("pandoc -v", path).splitlines()[0].split(" ")[-1]
180-
181169
def python_query(cmd, path):
182170
"""Execute Python command using the Python interpreter located in *path*."""
183171
the_exe = get_python_executable(path)

0 commit comments

Comments
 (0)