Skip to content

Commit

Permalink
🔼 Swap update command based on myst language env var
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch committed Aug 2, 2023
1 parent 89a5c91 commit 8b5d9b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/myst-cli/src/session/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import version from '../version.js';

const CONFIG_FILES = ['myst.yml'];
const API_URL = 'https://api.mystmd.org';
const NPM_COMMAND = 'npm i -g mystmd@latest';
const PIP_COMMAND = 'pip install -U mystmd';

export function logUpdateAvailable({
current,
Expand Down Expand Up @@ -81,7 +83,7 @@ export class Session implements ISession {
logUpdateAvailable({
current: version,
latest: this._latestVersion,
upgradeCommand: 'npm i -g mystmd@latest',
upgradeCommand: process.env.MYST_LANG === 'PYTHON' ? PIP_COMMAND : NPM_COMMAND,
twitter: 'MystMarkdown',
}),
);
Expand Down
2 changes: 2 additions & 0 deletions packages/mystmd-py/mystmd_py/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pathlib
import shutil
import subprocess
Expand Down Expand Up @@ -35,6 +36,7 @@ def main():
[node, PATH_TO_BIN_JS, *sys.argv[1:]],
stdin=sys.stdin,
stdout=sys.stdout,
env={**os.environ, "MYST_LANG": "PYTHON"},
)
sys.exit(myst_proc.wait())

Expand Down

0 comments on commit 8b5d9b7

Please sign in to comment.