Skip to content
Permalink
Browse files

feat(maker): create and consume a common util to check makers' suppor…

…ted platforms
  • Loading branch information
anulman authored and MarshallOfSound committed Mar 13, 2017
1 parent f10fbd1 commit fa53340b8aab110da849f77f2df9ffe79c1fb042
@@ -4,6 +4,9 @@ import pify from 'pify';

import { ensureFile } from '../../util/ensure-output';
import configFn from '../../util/config-fn';
import { checkSupportedPlatforms } from '../../util/check-supported-platforms';

export const supportedPlatforms = checkSupportedPlatforms('electron-installer-dmg');

export default async (dir, appName, targetArch, forgeConfig, packageJSON) => { // eslint-disable-line
const outPath = path.resolve(dir, '../make', `${appName}.dmg`);
@@ -4,6 +4,9 @@ import pify from 'pify';
import zipFolder from 'zip-folder';

import { ensureFile } from '../../util/ensure-output';
import { checkSupportedPlatforms } from '../../util/check-supported-platforms';

export const supportedPlatforms = checkSupportedPlatforms('zip-folder');

const zipPromise = (from, to) =>
new Promise((resolve, reject) => {
@@ -4,6 +4,9 @@ import pify from 'pify';

import { ensureFile } from '../../util/ensure-output';
import configFn from '../../util/config-fn';
import { checkSupportedPlatforms } from '../../util/check-supported-platforms';

export const supportedPlatforms = checkSupportedPlatforms('electron-installer-flatpak');

function flatpakArch(nodeArch) {
switch (nodeArch) {
@@ -4,6 +4,9 @@ import pify from 'pify';

import { ensureFile } from '../../util/ensure-output';
import configFn from '../../util/config-fn';
import { checkSupportedPlatforms } from '../../util/check-supported-platforms';

export const supportedPlatforms = checkSupportedPlatforms('electron-installer-redhat');

function rpmArch(nodeArch) {
switch (nodeArch) {
@@ -5,6 +5,9 @@ import { spawnPromise, findActualExecutable } from 'spawn-rx';

import { ensureDirectory } from '../../util/ensure-output';
import configFn from '../../util/config-fn';
import { checkSupportedPlatforms } from '../../util/check-supported-platforms';

export const supportedPlatforms = checkSupportedPlatforms('electron-windows-store');

// NB: This is not a typo, we require AppXs to be built on 64-bit
// but if we're running in a 32-bit node.js process, we're going to
@@ -4,6 +4,9 @@ import path from 'path';

import { ensureDirectory } from '../../util/ensure-output';
import configFn from '../../util/config-fn';
import { checkSupportedPlatforms } from '../../util/check-supported-platforms';

export const supportedPlatforms = checkSupportedPlatforms('electron-winstaller');

export default async (dir, appName, targetArch, forgeConfig, packageJSON) => { // eslint-disable-line
const outPath = path.resolve(dir, `../make/squirrel.windows/${targetArch}`);
@@ -0,0 +1,5 @@
export function checkSupportedPlatforms(pkg) {
return require(`${pkg}/package.json`).os || [];
}

export default checkSupportedPlatforms;

0 comments on commit fa53340

Please sign in to comment.
You can’t perform that action at this time.