Skip to content

Commit

Permalink
feat(initializer): add electron-squirrel-startup to the default template
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Sep 10, 2017
1 parent 6c30219 commit e0e42aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/init/init-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import yarnOrNpm from '../util/yarn-or-npm';

const d = debug('electron-forge:init:npm');

export const deps = ['electron-compile'];
export const deps = ['electron-compile', 'electron-squirrel-startup'];
export const devDeps = ['babel-preset-env', 'babel-preset-react', 'babel-plugin-transform-async-to-generator', 'electron-forge'];
export const exactDevDeps = ['electron-prebuilt-compile'];
export const standardDeps = ['standard'];
Expand Down
5 changes: 5 additions & 0 deletions tmpl/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { app, BrowserWindow } from 'electron';

// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require('electron-squirrel-startup')) {
app.quit();
}

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
Expand Down

0 comments on commit e0e42aa

Please sign in to comment.