diff --git a/.eslintrc.js b/.eslintrc.js index a9b517f..29833a2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,7 @@ module.exports = { indent: [ 2, 4, - {"SwitchCase": 1} + {SwitchCase: 1} ], quotes: [ 2, diff --git a/app/src/components/contextMenu/contextMenu.js b/app/src/components/contextMenu/contextMenu.js index 6f74245..9510452 100644 --- a/app/src/components/contextMenu/contextMenu.js +++ b/app/src/components/contextMenu/contextMenu.js @@ -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 = [ { diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 4ecce99..5fd6108 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -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()); @@ -118,7 +118,7 @@ function setUpPaths() { paths.APP_STATIC_JS = path.join(paths.APP_SRC, 'static') + '/**/*.js'; paths.APP_STATIC_DEST = path.join(paths.APP_DEST, 'static'); 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'; return paths; diff --git a/src/buildApp.js b/src/buildApp.js index e15d0b8..f6eb887 100644 --- a/src/buildApp.js +++ b/src/buildApp.js @@ -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'; diff --git a/src/iconBuild.js b/src/iconBuild.js index 45e0aeb..1517f24 100644 --- a/src/iconBuild.js +++ b/src/iconBuild.js @@ -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)) { diff --git a/test/module/getIcon-spec.js b/test/module/getIcon-spec.js index 343fe40..753a505 100644 --- a/test/module/getIcon-spec.js +++ b/test/module/getIcon-spec.js @@ -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); }); diff --git a/test/module/index-spec.js b/test/module/index-spec.js index 88e3364..9642714 100644 --- a/test/module/index-spec.js +++ b/test/module/index-spec.js @@ -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);