mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	fix(ci): failing due to electron-rebuild
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/website.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/website.yml
									
									
									
									
										vendored
									
									
								
							@@ -26,7 +26,7 @@ jobs:
 | 
				
			|||||||
      - uses: pnpm/action-setup@v4
 | 
					      - uses: pnpm/action-setup@v4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Install dependencies
 | 
					      - name: Install dependencies
 | 
				
			||||||
        run: pnpm install --filter website... --frozen-lockfile
 | 
					        run: pnpm install --filter website --frozen-lockfile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Build the website
 | 
					      - name: Build the website
 | 
				
			||||||
        run: pnpm website:build
 | 
					        run: pnpm website:build
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
import { join, resolve } from "path";
 | 
					import { join, resolve } from "path";
 | 
				
			||||||
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync } from "fs";
 | 
					import { cpSync, exists, existsSync, mkdirSync, readFileSync, rmSync } from "fs";
 | 
				
			||||||
import { execSync } from "child_process";
 | 
					import { execSync } from "child_process";
 | 
				
			||||||
import { rebuild } from "@electron/rebuild"
 | 
					import { rebuild } from "@electron/rebuild"
 | 
				
			||||||
import { getElectronPath, isNixOS } from "./utils.mjs";
 | 
					import { getElectronPath, isNixOS } from "./utils.mjs";
 | 
				
			||||||
@@ -12,8 +12,15 @@ function copyNativeDependencies(projectRoot: string) {
 | 
				
			|||||||
    if (existsSync(destPath)) {
 | 
					    if (existsSync(destPath)) {
 | 
				
			||||||
        rmSync(destPath, { recursive: true });
 | 
					        rmSync(destPath, { recursive: true });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    mkdirSync(destPath);
 | 
					    mkdirSync(destPath, { recursive: true });
 | 
				
			||||||
    cpSync(join(workspaceRoot, "node_modules/better-sqlite3"), destPath, { recursive: true, dereference: true });
 | 
					
 | 
				
			||||||
 | 
					    const sourcePath = join(workspaceRoot, "node_modules/better-sqlite3");
 | 
				
			||||||
 | 
					    if (!existsSync(sourcePath)) {
 | 
				
			||||||
 | 
					        console.warn("Nothing to rebuild as source path is missing:", sourcePath);
 | 
				
			||||||
 | 
					        console.info("For CI builds with filtered package installs, this is normal. For normal development, it's not.");
 | 
				
			||||||
 | 
					        process.exit(0);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    cpSync(sourcePath, destPath, { recursive: true, dereference: true });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function rebuildNativeDependencies(projectRoot: string) {
 | 
					function rebuildNativeDependencies(projectRoot: string) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user