Use const

This commit is contained in:
Jessica Lord 2016-01-14 13:16:42 -08:00
parent f31289c735
commit 9103253f62
10 changed files with 55 additions and 72 deletions

View file

@ -1,22 +1,18 @@
var appFolder, exeName, fs, path, spawn, spawnUpdate, updateExe;
fs = require('fs');
path = require('path');
spawn = require('child_process').spawn;
const fs = require('fs');
const path = require('path');
const spawn = require('child_process').spawn;
// i.e. my-app/app-0.1.13/
appFolder = path.dirname(process.execPath);
const appFolder = path.dirname(process.execPath);
// i.e. my-app/Update.exe
updateExe = path.resolve(appFolder, '..', 'Update.exe');
const updateExe = path.resolve(appFolder, '..', 'Update.exe');
exeName = path.basename(process.execPath);
const exeName = path.basename(process.execPath);
// Spawn a command and invoke the callback when it completes with an error
// and the output from standard out.
spawnUpdate = function(args, detached, callback) {
var spawnUpdate = function(args, detached, callback) {
var error, error1, errorEmitted, spawnedProcess, stderr, stdout;
try {
spawnedProcess = spawn(updateExe, args, {