diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 713b30bc..939a12d1 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -10,7 +10,7 @@ Thanks for your interest in contributing to this project! This document aims to ## Running locally -- Install [NodeJS v5.10.0](https://nodejs.org/en/). +- Install [NodeJS](https://nodejs.org/en/). Sadly we need to enforce the same NodeJS version that the Electron version we use is running to avoid module version mismatches when building native dependencies (`electron-rebuild` doesn't seem to be enough). diff --git a/lib/gui/etcher.js b/lib/gui/etcher.js index 94d37291..343b3b1b 100644 --- a/lib/gui/etcher.js +++ b/lib/gui/etcher.js @@ -17,7 +17,6 @@ 'use strict'; const electron = require('electron'); -const globalShortcut = require('global-shortcut'); const path = require('path'); const elevate = require('../src/elevate'); const packageJSON = require('../../package.json'); @@ -64,7 +63,7 @@ electron.app.on('ready', function() { mainWindow = null; }); - globalShortcut.register('CmdOrCtrl+Alt+I', function() { + electron.globalShortcut.register('CmdOrCtrl+Alt+I', function() { mainWindow.webContents.openDevTools(); }); diff --git a/lib/gui/os/open-external/directives/open-external.js b/lib/gui/os/open-external/directives/open-external.js index c195672a..589622f6 100644 --- a/lib/gui/os/open-external/directives/open-external.js +++ b/lib/gui/os/open-external/directives/open-external.js @@ -16,7 +16,7 @@ 'use strict'; -const shell = require('shell'); +const electron = require('electron'); const os = require('os'); const nodeOpen = require('open'); @@ -64,7 +64,7 @@ module.exports = function() { return nodeOpen(attributes.osOpenExternal); } - shell.openExternal(attributes.osOpenExternal); + electron.shell.openExternal(attributes.osOpenExternal); }); } }; diff --git a/lib/gui/utils/path/filters/basename.js b/lib/gui/utils/path/filters/basename.js index 6df56189..133f8e0b 100644 --- a/lib/gui/utils/path/filters/basename.js +++ b/lib/gui/utils/path/filters/basename.js @@ -31,6 +31,12 @@ module.exports = function() { * @example * {{ '/foo/bar/baz' | basename }} */ - return path.basename; + return function(input) { + if (!input) { + return; + } + + return path.basename(input); + } }; diff --git a/package.json b/package.json index 904483ad..f0b5e8bc 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "description": "An image flasher with support for Windows, OS X and GNU/Linux.", "homepage": "https://github.com/resin-io/etcher", "engines" : { - "node" : "5.10.0" + "node" : "6.1.0" }, "repository": { "type": "git", @@ -82,7 +82,7 @@ "electron-mocha": "^1.2.2", "electron-osx-sign": "^0.3.0", "electron-packager": "^7.0.1", - "electron-prebuilt": "0.37.6", + "electron-prebuilt": "1.1.1", "gulp": "^3.9.0", "gulp-jscs": "^3.0.2", "gulp-jshint": "^2.0.0", diff --git a/tests/gui/os/open-external.spec.js b/tests/gui/os/open-external.spec.js index 2cddf356..9c3e5bf7 100644 --- a/tests/gui/os/open-external.spec.js +++ b/tests/gui/os/open-external.spec.js @@ -19,7 +19,7 @@ const m = require('mochainon'); const os = require('os'); const angular = require('angular'); -const shell = require('shell'); +const electron = require('electron'); require('angular-mocks'); describe('Browser: OSOpenExternal', function() { @@ -56,7 +56,7 @@ describe('Browser: OSOpenExternal', function() { }); it('should call Electron shell.openExternal with the attribute value', function() { - const shellExternalStub = m.sinon.stub(shell, 'openExternal'); + const shellExternalStub = m.sinon.stub(electron.shell, 'openExternal'); const element = $compile('Resin.io')($rootScope); element.triggerHandler('click'); $rootScope.$digest(); diff --git a/tests/gui/utils/path.spec.js b/tests/gui/utils/path.spec.js index 30af15af..bceeeb58 100644 --- a/tests/gui/utils/path.spec.js +++ b/tests/gui/utils/path.spec.js @@ -19,6 +19,10 @@ describe('Browser: Path', function() { basenameFilter = _basenameFilter_; })); + it('should return undefined if no input', function() { + m.chai.expect(basenameFilter()).to.be.undefined; + }); + it('should return the basename', function() { const isWindows = os.platform() === 'win32'; let basename;