Skip to main content
Glama
lininn
by lininn
build.js1.06 kB
import { execSync } from 'child_process'; import { promises as fs } from 'fs'; import path from 'path'; const main = async () => { try { // Run the TypeScript compiler console.log('Building project with tsc...'); execSync('tsc', { stdio: 'inherit' }); console.log('Build completed.'); // Add shebang to the entry file const entryFilePath = path.join(process.cwd(), 'dist', 'index.js'); console.log(`Adding shebang to ${entryFilePath}...`); let content = await fs.readFile(entryFilePath, 'utf-8'); if (!content.startsWith('#!/usr/bin/env node')) { content = `#!/usr/bin/env node\n${content}`; await fs.writeFile(entryFilePath, content, 'utf-8'); console.log('Shebang added successfully.'); } else { console.log('Shebang already exists.'); } // Ensure the file is executable await fs.chmod(entryFilePath, 0o755); console.log('Set executable permission on entry file.'); } catch (error) { console.error('Build process failed:', error); process.exit(1); } }; main();

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/lininn/gitlab-review-mcp'

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