@houmak/minerva-mcp-server
Version:
Minerva Model Context Protocol (MCP) Server for Microsoft 365 and Azure integrations
55 lines (41 loc) • 1.76 kB
JavaScript
/**
* Script pour copier les scripts PowerShell dans le package npm
* Ce script s'exécute après l'installation du package
*/
import fs from 'fs-extra';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
async function copyPowerShellScripts() {
try {
// Get the current directory (src/mcp)
const currentDir = __dirname;
// Path to the powershell directory (in Docker: /app/powershell, in dev: ../../powershell)
// In Docker, we're in /app/scripts, so we need to go up one level to /app, then to powershell
const sourcePath = path.join(currentDir, '..', 'powershell');
// Path to the dist/powershell directory
const destPath = path.join(currentDir, '..', 'dist', 'powershell');
console.log('Copying PowerShell scripts...');
console.log(`Source: ${sourcePath}`);
console.log(`Destination: ${destPath}`);
// Check if source directory exists
if (!await fs.pathExists(sourcePath)) {
console.error(`Source directory does not exist: ${sourcePath}`);
process.exit(1);
}
// Create destination directory if it doesn't exist
await fs.ensureDir(destPath);
// Copy the entire powershell directory
await fs.copy(sourcePath, destPath);
console.log('PowerShell scripts copied successfully!');
// List the copied files for verification
const files = await fs.readdir(destPath);
console.log('Copied files:', files);
} catch (error) {
console.error('Error copying PowerShell scripts:', error);
process.exit(1);
}
}
copyPowerShellScripts();