From 08076a4af1acb2b68fd89a0a4f3d655a2c2b1681 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 18 Nov 2014 13:48:08 -0800 Subject: [PATCH] Only call callback once --- src/browser/squirrel-update.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/browser/squirrel-update.coffee b/src/browser/squirrel-update.coffee index 468863221..669db9c11 100644 --- a/src/browser/squirrel-update.coffee +++ b/src/browser/squirrel-update.coffee @@ -71,7 +71,6 @@ updatePath = (callback) -> @echo off "%~dp0\\#{relativeExePath}" %* """ - fs.writeFile(atomCommandPath, atomCommand, callback) apmCommandPath = path.join(binFolder, 'apm.cmd') relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm.cmd')) @@ -79,7 +78,10 @@ updatePath = (callback) -> @echo off "%~dp0\\#{relativeApmPath}" %* """ - fs.writeFile(apmCommandPath, apmCommand, callback) + + fs.writeFile atomCommandPath, atomCommand, -> + fs.writeFile apmCommandPath, apmCommand, -> + callback() getPath = (callback) -> spawnReg ['query', environmentKeyPath, '/v', 'Path'], (error, stdout) ->