Skip to main content
Glama
sync-version.mjs752 B
import fs from 'node:fs' import path from 'node:path' const packageJsonPath = path.resolve(import.meta.dirname, '../package.json') let { version } = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) let passedVersion = process.argv[2] if (passedVersion) { passedVersion = passedVersion.trim().replace(/^v/, '') if (version !== passedVersion) { console.log(`Syncing version from ${version} to ${passedVersion}`) version = passedVersion const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) packageJson.version = version fs.writeFileSync(path.resolve('./package.json'), JSON.stringify(packageJson, null, 2) + '\n', { encoding: 'utf-8' }) } } else { throw new Error('Version argument is required') }

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/krtw00/search-mcp'

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