orchestry-mcp
Version:
Orchestry MCP Server for multi-session task management
38 lines (30 loc) • 1.02 kB
JavaScript
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
function addShebang(fileName) {
const distPath = path.join(__dirname, '../dist', fileName);
if (!fs.existsSync(distPath)) {
console.log(`⏭️ Skipping ${fileName} (not found)`);
return;
}
// Read the file
const content = fs.readFileSync(distPath, 'utf8');
// Add shebang if not present
if (!content.startsWith('#!/usr/bin/env node')) {
const newContent = '#!/usr/bin/env node\n' + content;
fs.writeFileSync(distPath, newContent);
// Make executable
fs.chmodSync(distPath, '755');
console.log(`✅ Added shebang to ${fileName}`);
} else {
console.log(`✅ Shebang already present in ${fileName}`);
}
}
// Add shebang to all executable files
addShebang('index.js');
addShebang('mcp-with-ui.js');
addShebang('unified-server.js');
addShebang('launcher.js');
addShebang('orchestry.js');