@@ -25,6 +25,16 @@ describe "Windows squirrel updates", ->
|
|||||||
else
|
else
|
||||||
originalSpawn('ls')
|
originalSpawn('ls')
|
||||||
|
|
||||||
|
it "ignores errors spawning Squirrel", ->
|
||||||
|
jasmine.unspy(ChildProcess, 'spawn')
|
||||||
|
spyOn(ChildProcess, 'spawn').andCallFake -> throw new Error("EBUSY")
|
||||||
|
|
||||||
|
app = quit: jasmine.createSpy('quit')
|
||||||
|
expect(SquirrelUpdate.handleStartupEvent(app, '--squirrel-install')).toBe true
|
||||||
|
|
||||||
|
waitsFor ->
|
||||||
|
app.quit.callCount is 1
|
||||||
|
|
||||||
it "quits the app on all squirrel events", ->
|
it "quits the app on all squirrel events", ->
|
||||||
app = quit: jasmine.createSpy('quit')
|
app = quit: jasmine.createSpy('quit')
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,15 @@ environmentKeyPath = 'HKCU\\Environment'
|
|||||||
# Spawn a command and invoke the callback when it completes with an error
|
# Spawn a command and invoke the callback when it completes with an error
|
||||||
# and the output from standard out.
|
# and the output from standard out.
|
||||||
spawn = (command, args, callback) ->
|
spawn = (command, args, callback) ->
|
||||||
spawnedProcess = ChildProcess.spawn(command, args)
|
|
||||||
|
|
||||||
stdout = ''
|
stdout = ''
|
||||||
|
|
||||||
|
try
|
||||||
|
spawnedProcess = ChildProcess.spawn(command, args)
|
||||||
|
catch error
|
||||||
|
# Spawn can throw an error
|
||||||
|
process.nextTick -> callback?(error, stdout)
|
||||||
|
return
|
||||||
|
|
||||||
spawnedProcess.stdout.on 'data', (data) -> stdout += data
|
spawnedProcess.stdout.on 'data', (data) -> stdout += data
|
||||||
|
|
||||||
error = null
|
error = null
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário