Refactor Squirrel startup code

This commit is contained in:
Gregory Schier committed 2019-05-10 15:20:07 -04:00
1 parent 499302f329
commit ec60e2128e
4 files changed
+16 -22

No files matched your search

@@ -4,36 +4,30 @@ import { app } from 'electron';
function run(args, done) {
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
spawn(updateExe, args, {
detached: true,
}).on('close', done);
spawn(updateExe, args, { detached: true }).on('close', done);
}
export function checkIfRestartNeeded() {
if (process.platform === 'win32') {
const cmd = process.argv[1];
console.log('processing squirrel command `%s`', cmd);
const target = path.basename(process.execPath);
return false;
}
if (cmd === '--squirrel-install') {
const cmd = process.argv[1];
console.log('processing squirrel command `%s`', cmd);
const target = path.basename(process.execPath);
switch (cmd) {
case '--squirrel-install':
run(['--createShortcut=' + target + ''], app.quit);
return true;
}
if (cmd === '--squirrel-updated') {
app.quit();
return true;
}
if (cmd === '--squirrel-uninstall') {
case '--squirrel-uninstall':
run(['--removeShortcut=' + target + ''], app.quit);
return true;
}
if (cmd === '--squirrel-obsolete') {
case '--squirrel-updated':
case '--squirrel-obsolete':
app.quit();
return true;
}
}
return false;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "insomnia-plugin-cookie-jar",
"version": "1.0.11",
"version": "1.0.13",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "insomnia-plugin-jsonpath",
"version": "1.0.15",
"version": "1.0.16",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "insomnia-plugin-response",
"version": "1.0.19",
"version": "1.0.22",
"lockfileVersion": 1,
"requires": true,
"dependencies": {