Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Check platform.system to fix myst on Windows #1510

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions packages/mystmd-py/src/mystmd_py/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import pathlib
import platform
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -35,11 +36,18 @@ def main():
"Please update to the latest LTS release, using your preferred package manager\n"
"or following instructions here: https://nodejs.org/en/download"
)
os.execve(
node,
[node.name, PATH_TO_BIN_JS, *sys.argv[1:]],
{**os.environ, "MYST_LANG": "PYTHON"},
)

node_args = [PATH_TO_BIN_JS, *sys.argv[1:]]
node_env = {**os.environ, "MYST_LANG": "PYTHON"}
if platform.system() == "Windows":
result = subprocess.run([node, *node_args], env=node_env)
sys.exit(result.returncode)
else:
os.execve(
node,
[node.name, *node_args],
node_env,
)


if __name__ == "__main__":
Expand Down
Loading