Follow the existing convention to use the provided grunt instance

This commit is contained in:
Brad Christensen 2020-01-19 23:18:50 +13:00
parent 25101b5a02
commit b931e5d273
1 changed files with 16 additions and 17 deletions

View File

@ -3,31 +3,30 @@
const fs = require('fs-extra');
const path = require('path');
const debug = require('debug');
const grunt = require('grunt');
const webpackConfig = require('./build/webpack.config');
const webpackConfigTest = require('./test/test.webpack.config');
const pkg = require('./package.json');
const skipCodeSigning = grunt.option('no-sign');
let codeSignConfig;
if (!skipCodeSigning) {
try {
codeSignConfig = require('../keys/codesign');
} catch (err) {
throw new Error(
'Unable to load code signing config from ../keys/codesign.\n' +
'This is needed for production builds targeting macOS.\n' +
'For development builds, run with the `--no-sign` arg to skip code signing,\n' +
'e.g. `npm start -- --no-sign`'
);
}
}
debug.enable('electron-notarize');
module.exports = function(grunt) {
const skipCodeSigning = grunt.option('no-sign');
let codeSignConfig;
if (!skipCodeSigning) {
try {
codeSignConfig = require('../keys/codesign');
} catch (err) {
throw new Error(
'Unable to load code signing config from ../keys/codesign.\n' +
'This is needed for production builds targeting macOS.\n' +
'For development builds, run with the `--no-sign` arg to skip code signing,\n' +
'e.g. `npm start -- --no-sign`'
);
}
}
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);