Skip to content

Commit a7aa979

Browse files
committed
feat: Build snap packages for Linux
Closes #509
1 parent eff85c3 commit a7aa979

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/targets/snap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class SnapTarget extends Target {
5858
}
5959
}
6060

61-
await this.helper.computeDesktopEntry(this.options, "$snap.$app", path.join(snapDir, "setup", "gui", `${snap.name}.desktop`), {
61+
await this.helper.computeDesktopEntry(this.options, `${snap.name}`, path.join(snapDir, "setup", "gui", `${snap.name}.desktop`), {
6262
"Icon": "${SNAP}/meta/gui/icon.png"
6363
})
6464

test/src/helpers/packTester.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ async function checkLinuxResult(outDir: string, packager: Packager, checkOptions
208208
if (target === "appimage") {
209209
result.push(`${appInfo.name}-${appInfo.version}-${arch === Arch.x64 ? "x86_64" : Arch[arch]}.AppImage`)
210210
}
211-
else if (target === "deb") {
212-
result.push(`${appInfo.name}_${appInfo.version}_${arch === Arch.x64 ? "amd64" : Arch[arch]}.deb`)
211+
else if (target === "deb" || target === "snap") {
212+
result.push(`${appInfo.name}_${appInfo.version}_${arch === Arch.x64 ? "amd64" : Arch[arch]}.${target}`)
213213
}
214214
else {
215215
result.push(`TestApp-${appInfo.version}.${target}`)

test/src/linux/linuxPackagerTest.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ import { Platform } from "out"
55

66
test.ifDevOrLinuxCi("AppImage", app({targets: Platform.LINUX.createTarget()}))
77

8-
// test.ifNotCi("snap", app({targets: Platform.LINUX.createTarget("snap")}))
8+
if (process.platform === "linux") {
9+
test("snap", app({
10+
targets: Platform.LINUX.createTarget("snap"),
11+
config: {
12+
productName: "Snap Electron Builder Test",
13+
},
14+
appMetadata: {
15+
name: "snap-electron-builder-test",
16+
},
17+
}))
18+
}
919

1020
test.ifDevOrLinuxCi("AppImage - default icon, custom executable and custom desktop", app({
1121
targets: Platform.LINUX.createTarget("appimage"),

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.5.29.tgz#29f4dd9314fbccb080d8bd84b9c23811ec5090c2"
6868

6969
"@types/node@*":
70-
version "6.0.52"
71-
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.52.tgz#1ac3a99b42320f9e463482f25af4c2359473aaa6"
70+
version "6.0.53"
71+
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.53.tgz#8c300ca8ba51f80f98f3525b932ff47c6efd6be1"
7272

7373
"@types/source-map-support@^0.2.28":
7474
version "0.2.28"

0 commit comments

Comments
 (0)