Skip to content

Commit

Permalink
feat: Build snap packages for Linux
Browse files Browse the repository at this point in the history
Closes #509
  • Loading branch information
develar committed Dec 24, 2016
1 parent eff85c3 commit a7aa979
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class SnapTarget extends Target {
}
}

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

Expand Down
4 changes: 2 additions & 2 deletions test/src/helpers/packTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ async function checkLinuxResult(outDir: string, packager: Packager, checkOptions
if (target === "appimage") {
result.push(`${appInfo.name}-${appInfo.version}-${arch === Arch.x64 ? "x86_64" : Arch[arch]}.AppImage`)
}
else if (target === "deb") {
result.push(`${appInfo.name}_${appInfo.version}_${arch === Arch.x64 ? "amd64" : Arch[arch]}.deb`)
else if (target === "deb" || target === "snap") {
result.push(`${appInfo.name}_${appInfo.version}_${arch === Arch.x64 ? "amd64" : Arch[arch]}.${target}`)
}
else {
result.push(`TestApp-${appInfo.version}.${target}`)
Expand Down
12 changes: 11 additions & 1 deletion test/src/linux/linuxPackagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ import { Platform } from "out"

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

// test.ifNotCi("snap", app({targets: Platform.LINUX.createTarget("snap")}))
if (process.platform === "linux") {
test("snap", app({
targets: Platform.LINUX.createTarget("snap"),
config: {
productName: "Snap Electron Builder Test",
},
appMetadata: {
name: "snap-electron-builder-test",
},
}))
}

test.ifDevOrLinuxCi("AppImage - default icon, custom executable and custom desktop", app({
targets: Platform.LINUX.createTarget("appimage"),
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.5.29.tgz#29f4dd9314fbccb080d8bd84b9c23811ec5090c2"

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

"@types/source-map-support@^0.2.28":
version "0.2.28"
Expand Down

0 comments on commit a7aa979

Please sign in to comment.