mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 02:28:55 +00:00
Cleanup
This commit is contained in:
parent
2bdb2ab753
commit
1174cbc28c
@ -12,7 +12,7 @@ module.exports = {
|
|||||||
indent: [
|
indent: [
|
||||||
2,
|
2,
|
||||||
4,
|
4,
|
||||||
{"SwitchCase": 1}
|
{SwitchCase: 1}
|
||||||
],
|
],
|
||||||
quotes: [
|
quotes: [
|
||||||
2,
|
2,
|
||||||
|
@ -4,7 +4,7 @@ const ipcMain = electron.ipcMain;
|
|||||||
const shell = electron.shell;
|
const shell = electron.shell;
|
||||||
const BrowserWindow = electron.BrowserWindow;
|
const BrowserWindow = electron.BrowserWindow;
|
||||||
|
|
||||||
function initContextMenu(mainWindow, sendMessage) {
|
function initContextMenu(mainWindow) {
|
||||||
ipcMain.on('contextMenuOpened', function(event, targetHref) {
|
ipcMain.on('contextMenuOpened', function(event, targetHref) {
|
||||||
const contextMenuTemplate = [
|
const contextMenuTemplate = [
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ gulp.task('release', callback => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('lint', () => {
|
gulp.task('lint', () => {
|
||||||
return gulp.src(['**/*.js', '!node_modules/**', '!app/node_modules/**', '!app/lib/**', '!lib/**'])
|
return gulp.src(['**/*.js', '!node_modules/**', '!app/node_modules/**', '!app/lib/**', '!lib/**', '!built-tests/**'])
|
||||||
.pipe(eslint())
|
.pipe(eslint())
|
||||||
.pipe(eslint.format())
|
.pipe(eslint.format())
|
||||||
.pipe(eslint.failAfterError());
|
.pipe(eslint.failAfterError());
|
||||||
@ -118,7 +118,7 @@ function setUpPaths() {
|
|||||||
paths.APP_STATIC_JS = path.join(paths.APP_SRC, 'static') + '/**/*.js';
|
paths.APP_STATIC_JS = path.join(paths.APP_SRC, 'static') + '/**/*.js';
|
||||||
paths.APP_STATIC_DEST = path.join(paths.APP_DEST, 'static');
|
paths.APP_STATIC_DEST = path.join(paths.APP_DEST, 'static');
|
||||||
paths.CLI_SRC_JS = paths.CLI_SRC + '/**/*.js';
|
paths.CLI_SRC_JS = paths.CLI_SRC + '/**/*.js';
|
||||||
paths.TEST_SRC_JS = paths.TEST_SRC + '/**/*.js';
|
paths.TEST_SRC_JS = paths.TEST_SRC + '/**/*.js';
|
||||||
paths.TEST_DEST_JS = paths.TEST_DEST + '/**/*.js';
|
paths.TEST_DEST_JS = paths.TEST_DEST + '/**/*.js';
|
||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
|
@ -3,7 +3,6 @@ import path from 'path';
|
|||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
|
|
||||||
import optionsFactory from './options';
|
import optionsFactory from './options';
|
||||||
import pngToIcns from './pngToIcns';
|
|
||||||
import iconBuild from './iconBuild';
|
import iconBuild from './iconBuild';
|
||||||
import packager from 'electron-packager';
|
import packager from 'electron-packager';
|
||||||
import tmp from 'tmp';
|
import tmp from 'tmp';
|
||||||
|
@ -28,14 +28,13 @@ function iconBuild(options, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.platform !== 'darwin') {
|
if (options.platform !== 'darwin') {
|
||||||
if (!iconIsPng(options.icon)) {
|
if (iconIsPng(options.icon)) {
|
||||||
|
returnCallback();
|
||||||
|
} else {
|
||||||
console.warn('Icon should be a png for Linux and Windows apps');
|
console.warn('Icon should be a png for Linux and Windows apps');
|
||||||
returnCallback();
|
returnCallback();
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
returnCallback();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iconIsIcns(options.icon)) {
|
if (iconIsIcns(options.icon)) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// need to subtract 2 from source maps
|
// need to subtract 2 from source maps
|
||||||
import 'source-map-support/register';
|
import 'source-map-support/register';
|
||||||
|
|
||||||
import tmp from 'tmp';
|
|
||||||
import chai from 'chai';
|
import chai from 'chai';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
@ -17,16 +16,16 @@ function testConvertPng(pngName, done) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let stat = fs.statSync(icnsPath);
|
let stat = fs.statSync(icnsPath);
|
||||||
assert.isTrue(stat.isFile(), 'Output icns file should be a path')
|
assert.isTrue(stat.isFile(), 'Output icns file should be a path');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe('Get Icon Module', function() {
|
describe('Get Icon Module', function() {
|
||||||
it('Can convert a rgb png to icns', function(done) {
|
it('Can convert a rgb png to icns', function(done) {
|
||||||
testConvertPng('iconSample.png', done);
|
testConvertPng('iconSample.png', done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Can convert a grey png to icns', function(done) {
|
it('Can convert a grey png to icns', function(done) {
|
||||||
testConvertPng('iconSampleGrey.png', done);
|
testConvertPng('iconSampleGrey.png', done);
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import tmp from 'tmp';
|
import tmp from 'tmp';
|
||||||
import chai from 'chai';
|
import chai from 'chai';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import nativefier from './../../lib/index';
|
import nativefier from './../../lib/index';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
@ -34,7 +33,7 @@ function checkApp(appPath, inputOptions, callback) {
|
|||||||
|
|
||||||
assert.strictEqual(inputOptions.targetUrl, nativefierConfig.targetUrl, 'Packaged app must have the same targetUrl as the input parameters');
|
assert.strictEqual(inputOptions.targetUrl, nativefierConfig.targetUrl, 'Packaged app must have the same targetUrl as the input parameters');
|
||||||
// app name is not consistent for linux
|
// app name is not consistent for linux
|
||||||
//assert.strictEqual(inputOptions.appName, nativefierConfig.name, 'Packaged app must have the same name as the input parameters');
|
// assert.strictEqual(inputOptions.appName, nativefierConfig.name, 'Packaged app must have the same name as the input parameters');
|
||||||
callback();
|
callback();
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
callback(exception);
|
callback(exception);
|
||||||
|
Loading…
Reference in New Issue
Block a user