haloapi-mcp-tools
Version:
Model Context Protocol (MCP) server for interacting with the HaloPSA API
39 lines (33 loc) • 983 B
JavaScript
/**
* Make script files executable
*
* This script is run during 'npm install' to make bin scripts executable.
*/
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
// Files to make executable
const executableFiles = [
path.join(__dirname, '..', 'bin', 'desktop-mcp')
];
// Make files executable
function makeExecutable(filePath) {
if (process.platform === 'win32') {
// Windows doesn't need chmod
console.log(`Skipping chmod for ${filePath} on Windows`);
return;
}
try {
if (fs.existsSync(filePath)) {
console.log(`Making ${filePath} executable...`);
execSync(`chmod +x "${filePath}"`);
console.log(`Successfully made ${filePath} executable`);
} else {
console.warn(`File not found: ${filePath}`);
}
} catch (error) {
console.error(`Error making ${filePath} executable:`, error.message);
}
}
// Process each file
executableFiles.forEach(makeExecutable);