Skip to content

Commit

Permalink
xs pathlib: bootstrap.js convention
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Nov 27, 2019
1 parent a211bfa commit d45c934
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xs-platform/pathlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ export function makePath(filename, { File, Iterator }) {
}

function bundleSource() {
let bundlePath;
const parts = filename.match(/vat(-)([^\.]+).js$/);
if (!parts) {
if (parts) {
bundlePath = `${butLast(filename)}vat_${parts[2]}-src.js`;
} else if (filename.match(/\/bootstrap.js$/)) {
bundlePath = `${butLast(filename)}bootstrap-src.js`;
} else {
throw new Error(`expected vat-NAME.js; got: ${filename}`);
}
const bundlePath = `${butLast(filename)}vat_${parts[2]}-src.js`;
console.log(`@@bundleSource ${filename} -> ${bundlePath}`);
const src = mk(bundlePath).readFileSync();
return {
Expand Down

0 comments on commit d45c934

Please sign in to comment.