File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments