diff --git a/packages/app-builder-lib/src/targets/snap.ts b/packages/app-builder-lib/src/targets/snap.ts index 2f7dd22c7cf..6179a232129 100644 --- a/packages/app-builder-lib/src/targets/snap.ts +++ b/packages/app-builder-lib/src/targets/snap.ts @@ -124,7 +124,6 @@ export default class SnapTarget extends Target { const archTriplet = archNameToTriplet(arch) appDescriptor.environment = { DISABLE_WAYLAND: options.allowNativeWayland ? "" : "1", - TMPDIR: "$XDG_RUNTIME_DIR", PATH: "$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH", SNAP_DESKTOP_RUNTIME: "$SNAP/gnome-platform", LD_LIBRARY_PATH: [ @@ -175,9 +174,6 @@ export default class SnapTarget extends Target { }) const snap = await this.createDescriptor(arch) - if (this.isUseTemplateApp) { - delete snap.parts - } const stageDir = await createStageDirPath(this, packager, arch) const snapArch = toLinuxArchString(arch, "snap") @@ -214,6 +210,17 @@ export default class SnapTarget extends Target { return } + if (this.isUseTemplateApp) { + // remove fields that are valid in snapcraft.yaml, but not snap.yaml + delete snap.compression + delete snap.contact + delete snap.donation + delete snap.issues + delete snap.parts + delete snap['source-code'] + delete snap.website + } + await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? "snap.yaml" : "snapcraft.yaml"), serializeToYaml(snap)) const hooksDir = await packager.getResource(options.hooks, "snap-hooks")