Skip to content

Commit

Permalink
Merge branch 'sort-vat-list' into xs-build-lite
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jan 19, 2020
2 parents f7814a5 + eb474bf commit 5ca5204
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/SwingSet/src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ import { insistCapData } from './capdata';
import { parseVatSlot } from './parseVatSlots';
import { buildStorageInMemory } from './hostStorage';

function byName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}

export function loadBasedir(basedir) {
console.log(`= loading config from basedir ${basedir}`);
const vats = new Map(); // name -> { sourcepath, options }
const subs = fs.readdirSync(basedir, { withFileTypes: true });
subs.sort(byName);
subs.forEach(dirent => {
if (dirent.name.endsWith('~') || ['.', '..'].includes(dirent.name)) {
return;
Expand Down

0 comments on commit 5ca5204

Please sign in to comment.