refactor(website/download): read version number from package.json

This commit is contained in:
Elian Doran 2025-06-14 14:34:31 +03:00
parent 6e97b08256
commit cf47abe849
No known key found for this signature in database

View File

@ -1,8 +1,10 @@
import rootPackageJson from '../../../../package.json';
export type Architecture = 'x64' | 'arm64'; export type Architecture = 'x64' | 'arm64';
export type Platform = 'mac' | 'windows' | 'linux'; export type Platform = 'mac' | 'windows' | 'linux';
let version = "v0.94.1"; let version = rootPackageJson.version;
export function buildDesktopDownloadUrl(platform: Platform, format: string, architecture: Architecture): string { export function buildDesktopDownloadUrl(platform: Platform, format: string, architecture: Architecture): string {
return `https://github.com/TriliumNext/Notes/releases/download/${version}/TriliumNextNotes-${version}-${platform}-${architecture}.${format}`; return `https://github.com/TriliumNext/Notes/releases/download/${version}/TriliumNextNotes-${version}-${platform}-${architecture}.${format}`;