Skip to content

Commit

Permalink
fix: strip extra fields out before creating snap.yaml (electron-userl…
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeJerred committed Sep 1, 2022
1 parent dd29013 commit d20ca1a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/app-builder-lib/src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -214,6 +213,16 @@ 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['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")
Expand Down

0 comments on commit d20ca1a

Please sign in to comment.