Merge pull request #1568 from rigrig/fix-boot-sort
boot: fix alphabetic sorting of *.boot.js filesmaster
commit
0084c774c6
|
|
@ -196,7 +196,7 @@ if (!Bangle.appRect) { // added in 2v11 - polyfill for older firmwares
|
||||||
// Append *.boot.js files
|
// Append *.boot.js files
|
||||||
// These could change bleServices/bleServiceOptions if needed
|
// These could change bleServices/bleServiceOptions if needed
|
||||||
var getPriority = /.*\.(\d+)\.boot\.js$/;
|
var getPriority = /.*\.(\d+)\.boot\.js$/;
|
||||||
require('Storage').list(/\.boot\.js/).sort((a,b)=>{
|
require('Storage').list(/\.boot\.js$/).sort((a,b)=>{
|
||||||
var aPriority = a.match(getPriority);
|
var aPriority = a.match(getPriority);
|
||||||
var bPriority = b.match(getPriority);
|
var bPriority = b.match(getPriority);
|
||||||
if (aPriority && bPriority){
|
if (aPriority && bPriority){
|
||||||
|
|
@ -206,7 +206,7 @@ require('Storage').list(/\.boot\.js/).sort((a,b)=>{
|
||||||
} else if (!aPriority && bPriority){
|
} else if (!aPriority && bPriority){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return a > b;
|
return a==b ? 0 : (a>b ? 1 : -1);
|
||||||
}).forEach(bootFile=>{
|
}).forEach(bootFile=>{
|
||||||
// we add a semicolon so if the file is wrapped in (function(){ ... }()
|
// we add a semicolon so if the file is wrapped in (function(){ ... }()
|
||||||
// with no semicolon we don't end up with (function(){ ... }()(function(){ ... }()
|
// with no semicolon we don't end up with (function(){ ... }()(function(){ ... }()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue