Skip to content

Commit

Permalink
feat(forge): support electron-forge 3.0 API
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed May 2, 2017
1 parent f01415a commit 002a714
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
7 changes: 6 additions & 1 deletion packages/electron-builder/src/forge/forge-maker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import * as path from "path"
import { build, CliOptions } from "../builder"

export function buildForge(appDir: string, options: CliOptions) {
export interface ForgeOptions {
readonly dir: string
}

export function buildForge(forgeOptions: ForgeOptions, options: CliOptions) {
const appDir = forgeOptions.dir
return build(Object.assign({
prepackaged: appDir,
config: {
Expand Down
6 changes: 4 additions & 2 deletions packages/electron-forge-maker-appimage/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {

const buildForge = require("electron-builder").buildForge

exports.default = function (appDir, appName, targetArch) {
return buildForge(appDir, {linux: [`appimage:${targetArch}`]})
exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true)

exports.default = function (options) {
return buildForge(options, {linux: [`appimage:${options.targetArch}`]})
}
6 changes: 4 additions & 2 deletions packages/electron-forge-maker-nsis-web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {

const buildForge = require("electron-builder").buildForge

exports.default = function (appDir, appName, targetArch) {
return buildForge(appDir, {win: [`nsis-web:${targetArch}`]})
exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true)

exports.default = function (options) {
return buildForge(options, {win: [`nsis-web:${options.targetArch}`]})
}
6 changes: 4 additions & 2 deletions packages/electron-forge-maker-nsis/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {

const buildForge = require("electron-builder").buildForge

exports.default = function (appDir, appName, targetArch) {
return buildForge(appDir, {win: [`nsis:${targetArch}`]})
exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true)

exports.default = function (options) {
return buildForge(options, {win: [`nsis:${options.targetArch}`]})
}
6 changes: 4 additions & 2 deletions packages/electron-forge-maker-snap/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {

const buildForge = require("electron-builder").buildForge

exports.default = function (appDir, appName, targetArch) {
return buildForge(appDir, {linux: [`snap:${targetArch}`]})
exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true)

exports.default = function (options) {
return buildForge(options, {linux: [`snap:${options.targetArch}`]})
}

0 comments on commit 002a714

Please sign in to comment.