Skip to main content
Glama
addShebang.js590 B
import { promises as fs } from "fs"; import path from "path"; const filePath = path.join(process.cwd(), "build", "index.js"); const shebang = "#!/usr/bin/env node\n"; async function addShebang() { try { let data = await fs.readFile(filePath, "utf8"); if (!data.startsWith(shebang)) { data = shebang + data; await fs.writeFile(filePath, data, "utf8"); console.log(`Shebang added to ${filePath}`); } else { console.log(`Shebang already exists in ${filePath}`); } } catch (err) { console.error(`Error: ${err.message}`); } } addShebang();

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/multiversx/mx-mcp'

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