Skip to content

Commit c5248cb

Browse files
committed
fix: пост инсталл скрипт теперь есть...
1 parent eb27f26 commit c5248cb

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

scripts/postinstall.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Postinstall script для blockmine
4+
* Устанавливает зеркало Prisma для РФ и запускает установку
5+
*/
6+
7+
const { execSync } = require('child_process');
8+
9+
// Устанавливаем зеркало Prisma для РФ (если не установлено вручную)
10+
if (!process.env.PRISMA_ENGINES_MIRROR) {
11+
process.env.PRISMA_ENGINES_MIRROR = 'https://registry.npmmirror.com/-/binary/prisma/';
12+
}
13+
if (!process.env.PRISMA_BINARIES_MIRROR) {
14+
process.env.PRISMA_BINARIES_MIRROR = 'https://registry.npmmirror.com/-/binary/prisma/';
15+
}
16+
17+
console.log('[BlockMine] Running postinstall...');
18+
19+
try {
20+
// Устанавливаем frontend зависимости без скриптов
21+
console.log('[BlockMine] Installing frontend dependencies...');
22+
execSync('npm install --workspace=frontend --ignore-scripts', {
23+
stdio: 'inherit',
24+
env: process.env
25+
});
26+
27+
// Генерируем Prisma клиент с зеркалом
28+
console.log('[BlockMine] Generating Prisma client...');
29+
execSync('prisma generate --schema=./backend/prisma/schema.prisma', {
30+
stdio: 'inherit',
31+
env: process.env
32+
});
33+
34+
console.log('[BlockMine] Postinstall completed successfully!');
35+
} catch (error) {
36+
console.error('[BlockMine] Postinstall failed:', error.message);
37+
process.exit(1);
38+
}

0 commit comments

Comments
 (0)