Skip to content

Commit 314fd03

Browse files
committed
Fixing lint errors
1 parent 9918d2d commit 314fd03

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

js/appinfo.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function parseJS(storageFile, options, app) {
169169
return Promise.resolve(storageFile);
170170
}
171171

172-
var AppInfo = {
172+
let AppInfo = {
173173
/* Get a list of commands needed to upload the file */
174174
getFileUploadCommands : (filename, data) => {
175175
const CHUNKSIZE = Const.UPLOAD_CHUNKSIZE;
@@ -189,7 +189,6 @@ var AppInfo = {
189189
/* Get a list of commands needed to upload a storage file */
190190
getStorageFileUploadCommands : (filename, data) => {
191191
const CHUNKSIZE = Const.UPLOAD_CHUNKSIZE;
192-
var cmd = "";
193192
// write code in chunks, in case it is too big to fit in RAM (fix #157)
194193
function getWriteData(offset) {
195194
return asJSExpr(data.substr(offset,CHUNKSIZE), {noHeatshrink:true});
@@ -198,7 +197,7 @@ var AppInfo = {
198197
// so we must ensure we always return a String
199198
// We could use E.toString but https://github.com/espruino/BangleApps/issues/2068#issuecomment-1211717749
200199
}
201-
var cmd = `\x10f=require('Storage').open(${JSON.stringify(filename)},'w');f.write(${getWriteData(0)});`;
200+
let cmd = `\x10f=require('Storage').open(${JSON.stringify(filename)},'w');f.write(${getWriteData(0)});`;
202201
for (let i=CHUNKSIZE;i<data.length;i+=CHUNKSIZE)
203202
cmd += `\n\x10f.write(${getWriteData(i)});`;
204203
return cmd;
@@ -436,7 +435,7 @@ var AppInfo = {
436435
// Check for apps which we may need to install
437436
if (app.dependencies) {
438437
Object.keys(app.dependencies).forEach(dependency=>{
439-
var dependencyType = app.dependencies[dependency];
438+
let dependencyType = app.dependencies[dependency];
440439
function handleDependency(dependencyChecker) {
441440
// now see if we can find one matching our dependency
442441
let found = appJSONInstalled.find(dependencyChecker);
@@ -455,11 +454,11 @@ var AppInfo = {
455454
promise = promise.then(()=>new Promise((resolve,reject)=>{
456455
console.log(`Install dependency '${dependency}':'${found.id}'`);
457456
return AppInfo.checkDependencies(found, device, uploadOptions)
458-
.then(() => uploadOptions.needsApp(found, uploadOptions))
459-
.then(appJSON => {
460-
if (appJSON) device.appsInstalled.push(appJSON);
461-
resolve();
462-
});
457+
.then(() => uploadOptions.needsApp(found, uploadOptions))
458+
.then(appJSON => {
459+
if (appJSON) device.appsInstalled.push(appJSON);
460+
resolve();
461+
}, reject);
463462
}));
464463
}
465464
}

js/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ function parseRJSON(str) {
514514
return json;
515515
}
516516

517-
var Utils = {
517+
let Utils = {
518518
Const : Const,
519519
DEVICEINFO : DEVICEINFO,
520520
CODEPAGE_CONVERSIONS : CODEPAGE_CONVERSIONS,

0 commit comments

Comments
 (0)