Skip to content

Commit 304ac6f

Browse files
committed
Try fix windows
1 parent 32c9fe5 commit 304ac6f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

smoketests/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,20 @@ def run_cmd(*args, capture_stderr=True, check=True, full_output=False, cmd_name=
172172
output.check_returncode()
173173
return output if full_output else output.stdout
174174

175+
@functools.cache
176+
def pnpm_path():
177+
pnpm = shutil.which("pnpm")
178+
if not pnpm:
179+
raise Exception("pnpm not installed")
180+
return pnpm
181+
182+
def pnpm(*args, **kwargs):
183+
return run_cmd(pnpm_path(), *args, **kwargs)
184+
175185
@functools.cache
176186
def build_typescript_sdk():
177-
run_cmd("pnpm", "install", cwd=TYPESCRIPT_BINDINGS_PATH)
178-
run_cmd("pnpm", "build", cwd=TYPESCRIPT_BINDINGS_PATH)
187+
pnpm("install", cwd=TYPESCRIPT_BINDINGS_PATH)
188+
pnpm("build", cwd=TYPESCRIPT_BINDINGS_PATH)
179189

180190
def spacetime(*args, **kwargs):
181191
return run_cmd(SPACETIME_BIN, *args, cmd_name="spacetime", **kwargs)

smoketests/tests/quickstart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import xmltodict
77

88
import smoketests
9-
from .. import Smoketest, STDB_DIR, run_cmd, TEMPLATE_CARGO_TOML, TYPESCRIPT_BINDINGS_PATH, build_typescript_sdk
9+
from .. import Smoketest, STDB_DIR, run_cmd, TEMPLATE_CARGO_TOML, TYPESCRIPT_BINDINGS_PATH, build_typescript_sdk, pnpm
1010

1111

1212
def _write_file(path: Path, content: str):
@@ -342,7 +342,7 @@ class TypeScript(Rust):
342342

343343
def server_postprocess(self, server_path: Path):
344344
build_typescript_sdk()
345-
run_cmd("pnpm", "install", f"spacetimedb@file:{TYPESCRIPT_BINDINGS_PATH}", cwd=server_path)
345+
pnpm("install", f"spacetimedb@file://{TYPESCRIPT_BINDINGS_PATH}", cwd=server_path)
346346

347347
def test_quickstart(self):
348348
"""Run the TypeScript quickstart guides for server."""

0 commit comments

Comments
 (0)