pad.libre-service.eu-etherpad/postinstall.js
2024-08-19 20:17:22 +02:00

23 lines
653 B
JavaScript

import { execSync } from 'child_process';
import fs from 'fs';
import path from 'path';
const packageJsonPath = path.resolve('./package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const devDependencies = packageJson.devDependencies || {};
let allDevDependenciesInstalled = true;
for (const dep in devDependencies) {
try {
console.log(dep)
fs.statSync('node_modules/' + dep);
} catch (error) {
allDevDependenciesInstalled = false;
console.error(`DevDependency ${dep} is not installed.`);
}
}
if (allDevDependenciesInstalled) {
execSync('pnpm run build:etherpad', { stdio: 'inherit' });
}