Allow absolute paths to files in cli.js command line arguments
This commit is contained in:
parent
c53595d31f
commit
9d6ff4cfbf
1 changed files with 4 additions and 1 deletions
|
|
@ -68,7 +68,10 @@ let exports_save = exports,
|
||||||
// fake fetch for worker to get wasm, if needed
|
// fake fetch for worker to get wasm, if needed
|
||||||
let fetch = function(url, opts = {}) {
|
let fetch = function(url, opts = {}) {
|
||||||
if (verbose) console.log({fetch: url});
|
if (verbose) console.log({fetch: url});
|
||||||
let buf = fs.readFileSync(`${dir}/${url}`);
|
if (!url.startsWith('/')) {
|
||||||
|
url = `${dir}/${url}`;
|
||||||
|
}
|
||||||
|
let buf = fs.readFileSync(url);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(new Promise((resolve, reject) => {
|
resolve(new Promise((resolve, reject) => {
|
||||||
if (opts.format === 'string') {
|
if (opts.format === 'string') {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue