mirror of
https://github.com/rio-labs/rio.git
synced 2025-12-18 03:04:46 -06:00
21 lines
340 B
Python
21 lines
340 B
Python
import subprocess
|
|
import sys
|
|
|
|
__all__ = ["npm", "npx"]
|
|
|
|
|
|
def _npm_command(command: str, *args: str):
|
|
subprocess.run(
|
|
[command, *args],
|
|
check=True,
|
|
shell=sys.platform == "win32",
|
|
)
|
|
|
|
|
|
def npm(*args: str):
|
|
_npm_command("npm", *args)
|
|
|
|
|
|
def npx(*args: str):
|
|
_npm_command("npx", *args)
|