mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-25 16:19:20 -04:00
Refactor Squirrel startup code
This commit is contained in:
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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "insomnia-plugin-cookie-jar",
|
||||
"version": "1.0.11",
|
||||
"version": "1.0.13",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "insomnia-plugin-jsonpath",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.16",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "insomnia-plugin-response",
|
||||
"version": "1.0.19",
|
||||
"version": "1.0.22",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
Reference in new issue
Block a user