mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00
Added post install script
This commit is contained in:
parent
be49d75fde
commit
dcb07a709d
10 changed files with 65 additions and 281 deletions
23
postinstall.js
Normal file
23
postinstall.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
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' });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue