Skip to main content
Glama
build_workspace_node_modules.py1.11 kB
#!/usr/bin/env python3 """ Downloads and installs workspace packages via Pnpm. """ import argparse import os import shutil import subprocess import sys if __name__ == "__main__": parser = argparse.ArgumentParser(description=__doc__) group = parser.add_mutually_exclusive_group(required=True) group.add_argument( "--package-dir", help="Path to the workspace member package", ) group.add_argument( "--root-dir", help="Path to the workspace root", ) parser.add_argument( "node_modules_out_path", help="Path to output `node_modules`", ) args = parser.parse_args() if args.root_dir: cwd = args.root_dir else: cwd = None cmd = ["pnpm", "install", "--frozen-lockfile"] exit_code = subprocess.call(cmd, cwd=cwd) if exit_code == 0: src = "node_modules" if cwd: src = os.path.join(cwd, src) shutil.copytree( src, os.path.join(args.node_modules_out_path, "node_modules"), symlinks=True, ) sys.exit(exit_code)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server