Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(flatpak): install the metadata from the pinned checkout
Elian Doran801ac1448129
diff --git a/apps/desktop/flatpak/org.triliumnotes.Trilium.yml b/apps/desktop/flatpak/org.triliumnotes.Trilium.ymlindex d9ad780e6b..75ee4bfbc0 100644--- a/apps/desktop/flatpak/org.triliumnotes.Trilium.yml+++ b/apps/desktop/flatpak/org.triliumnotes.Trilium.yml@@ -58,6 +58,8 @@ modules:- pnpm exec tsx apps/desktop/electron-forge/trim-locales.ts /app/lib/electron/locales- install -Dm755 trilium.sh /app/bin/trilium+ - install -Dm644 apps/desktop/flatpak/${FLATPAK_ID}.desktop /app/share/applications/${FLATPAK_ID}.desktop+ - install -Dm644 apps/desktop/flatpak/${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml- for s in 128 256 512; do install -Dm644 "apps/desktop/electron-forge/app-icon/png/${s}x${s}.png""/app/share/icons/hicolor/${s}x${s}/apps/${FLATPAK_ID}.png"; donesources:@@ -78,17 +80,6 @@ modules:sha256: c3bb8caba00f308733b0876d245e1e1f3ad656e6605f4f85dd861457267ae9f2dest: flatpak-node/pnpmonly-arches: [aarch64]+ # The launch wrapper stays a repo file, reviewable without opening the checkout.- type: filepath: trilium.sh-- # Separate module so a metadata edit does not invalidate app build.- - name: metadata- buildsystem: simple- build-commands:- - install -Dm644 ${FLATPAK_ID}.desktop /app/share/applications/${FLATPAK_ID}.desktop- - install -Dm644 ${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml- sources:- - type: file- path: org.triliumnotes.Trilium.desktop- - type: file- path: org.triliumnotes.Trilium.metainfo.xmldiff --git a/scripts/flatpak/update-repo.mts b/scripts/flatpak/update-repo.mtsindex fc9ec60049..18b2388d51 100644--- a/scripts/flatpak/update-repo.mts+++ b/scripts/flatpak/update-repo.mts@@ -1,17 +1,17 @@/**- * Writes the Flathub packaging repo's files from their vendored sources in- * `apps/desktop/flatpak/`: the manifest — with its git source pinned to the- * requested ref and its pnpm sources tracking that ref's `packageManager` —- * plus the launch wrapper, desktop file and metainfo.+ * Writes the Flathub packaging repo's manifest and launch wrapper from their+ * vendored sources in `apps/desktop/flatpak/`, with the manifest's git source+ * pinned to the requested ref and its pnpm sources tracking that ref's+ * `packageManager`. The desktop file and metainfo install from the pinned+ * checkout itself; `generated-sources.json` is a separate step:+ * ./scripts/flatpak/generate-sources.mts, run against the same ref's checkout.** Usage:** pnpm exec tsx ./scripts/flatpak/update-repo.mts <packaging-repo-dir> [ref]** `ref` defaults to HEAD; a tag pins `tag:` and `commit:`, anything else pins- * the bare commit (the beta case). `generated-sources.json` is a separate- * step: ./scripts/flatpak/generate-sources.mts, run against the same ref's- * checkout.+ * the bare commit (the beta case).*/import { execFileSync } from "node:child_process";@@ -21,11 +21,6 @@ import { join, resolve } from "node:path";const FLATPAK_DIR = join(import.meta.dirname, "../../apps/desktop/flatpak");const MANIFEST_NAME = "org.triliumnotes.Trilium.yml";-const COPIED_FILES = [- "trilium.sh",- "org.triliumnotes.Trilium.desktop",- "org.triliumnotes.Trilium.metainfo.xml"-];export async function main(argv: string[]) {const [repoDirArg, ref = "HEAD"] = argv;@@ -48,11 +43,8 @@ export async function main(argv: string[]) {}writeFileSync(join(repoDir, MANIFEST_NAME), manifest);- for (const file of COPIED_FILES) {- copyFileSync(join(FLATPAK_DIR, file), join(repoDir, file));- }- console.log(`Updated ${repoDir}: ${tag ?? "beta"} @ ${commit}, pnpm ${pnpmVersion}, `- + `${COPIED_FILES.length + 1} files.`);+ copyFileSync(join(FLATPAK_DIR, "trilium.sh"), join(repoDir, "trilium.sh"));+ console.log(`Updated ${repoDir}: ${tag ?? "beta"} @ ${commit}, pnpm ${pnpmVersion}.`);}/** Pins the manifest's git source; without a tag, the `tag:` line goes (a beta builds a bare commit). */