mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add initial SquirrelUpdate specs
This commit is contained in:
@@ -9,7 +9,7 @@ class AutoUpdater
|
||||
|
||||
quitAndInstall: ->
|
||||
if SquirrelUpdate.existsSync()
|
||||
SquirrelUpdate.restartAtom()
|
||||
SquirrelUpdate.restartAtom(require('app'))
|
||||
else
|
||||
require('auto-updater').quitAndInstall()
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ fs.lstatSyncNoException = (pathToStat) ->
|
||||
start = ->
|
||||
if process.platform is 'win32'
|
||||
SquirrelUpdate = require './squirrel-update'
|
||||
return if SquirrelUpdate.handleStartupEvent()
|
||||
squirrelCommand = process.argv[1]
|
||||
return if SquirrelUpdate.handleStartupEvent(app, squirrelCommand)
|
||||
|
||||
args = parseCommandLine()
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
app = require 'app'
|
||||
ChildProcess = require 'child_process'
|
||||
fs = require 'fs-plus'
|
||||
path = require 'path'
|
||||
@@ -198,15 +197,15 @@ exports.existsSync = ->
|
||||
fs.existsSync(updateDotExe)
|
||||
|
||||
# Restart Atom using the version pointed to by the atom.cmd shim
|
||||
exports.restartAtom = ->
|
||||
exports.restartAtom = (app) ->
|
||||
if projectPath = global.atomApplication?.lastFocusedWindow?.projectPath
|
||||
args = [projectPath]
|
||||
app.once 'will-quit', -> spawn(path.join(binFolder, 'atom.cmd'), args)
|
||||
app.quit()
|
||||
|
||||
# Handle squirrel events denoted by --squirrel-* command line arguments.
|
||||
exports.handleStartupEvent = ->
|
||||
switch process.argv[1]
|
||||
exports.handleStartupEvent = (app, squirrelCommand) ->
|
||||
switch squirrelCommand
|
||||
when '--squirrel-install'
|
||||
createShortcuts ->
|
||||
installContextMenu ->
|
||||
|
||||
Reference in New Issue
Block a user