2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 02:28:55 +00:00
This commit is contained in:
Jia Hao 2016-01-28 11:47:40 +08:00
parent 2bdb2ab753
commit 1174cbc28c
7 changed files with 11 additions and 15 deletions

View File

@ -12,7 +12,7 @@ module.exports = {
indent: [
2,
4,
{"SwitchCase": 1}
{SwitchCase: 1}
],
quotes: [
2,

View File

@ -4,7 +4,7 @@ const ipcMain = electron.ipcMain;
const shell = electron.shell;
const BrowserWindow = electron.BrowserWindow;
function initContextMenu(mainWindow, sendMessage) {
function initContextMenu(mainWindow) {
ipcMain.on('contextMenuOpened', function(event, targetHref) {
const contextMenuTemplate = [
{

View File

@ -77,7 +77,7 @@ gulp.task('release', callback => {
});
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.format())
.pipe(eslint.failAfterError());

View File

@ -3,7 +3,6 @@ import path from 'path';
import crypto from 'crypto';
import optionsFactory from './options';
import pngToIcns from './pngToIcns';
import iconBuild from './iconBuild';
import packager from 'electron-packager';
import tmp from 'tmp';

View File

@ -28,14 +28,13 @@ function iconBuild(options, callback) {
}
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');
returnCallback();
return;
} else {
returnCallback();
return;
}
return;
}
if (iconIsIcns(options.icon)) {

View File

@ -1,7 +1,6 @@
// need to subtract 2 from source maps
import 'source-map-support/register';
import tmp from 'tmp';
import chai from 'chai';
import fs from 'fs';
import path from 'path';
@ -17,16 +16,16 @@ function testConvertPng(pngName, done) {
}
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();
});
}
describe('Get Icon Module', function() {
it('Can convert a rgb png to icns', function(done) {
testConvertPng('iconSample.png', done);
});
it('Can convert a grey png to icns', function(done) {
testConvertPng('iconSampleGrey.png', done);
});

View File

@ -1,7 +1,6 @@
import tmp from 'tmp';
import chai from 'chai';
import fs from 'fs';
import os from 'os';
import path from 'path';
import nativefier from './../../lib/index';
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');
// 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();
} catch (exception) {
callback(exception);