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 2741e49
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions 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 @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 2741e49

Please sign in to comment.