Skip to content

Commit d6fc0d2

Browse files
committed
fix graaljs
1 parent bd523e5 commit d6fc0d2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/engines/graaljs.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ class GraalJSInstaller extends Installer {
6262
async install() {
6363
const root = `graalvm-ce-java11-${this.version}`;
6464
if (platform === 'darwin-x64') {
65+
await this.registerAsset(`${root}/Contents/Home/languages/js/graaljs.jar`);
6566
await this.registerAsset(`${root}/Contents/Home/languages/js/lib/libjsvm.dylib`);
6667
this.binPath = await this.registerBinary(`${root}/Contents/Home/languages/js/bin/js`, 'graaljs');
6768
} else if (platform === 'win32-x64') {
69+
await this.registerAsset(`${root}/languages/js/graaljs.jar`);
6870
await this.registerAsset(`${root}/languages/js/lib/jsvm.dll`);
6971
this.binPath = await this.registerBinary(`${root}/languages/js/bin/js.exe`, 'graaljs.exe');
7072
} else {
73+
await this.registerAsset(`${root}/languages/js/graaljs.jar`);
7174
await this.registerAsset(`${root}/languages/js/lib/libjsvm.so`);
7275
this.binPath = await this.registerBinary(`${root}/languages/js/bin/js`, 'graaljs');
7376
}

src/installer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const fetch = require('node-fetch');
1212
const { ESVU_PATH, ensureDirectory, symlink, platform, rmdir } = require('./common');
1313
const Logger = require('./logger');
1414

15+
const DL_FILE_PREFIX = 'esvu-';
16+
1517
function hash(string) {
1618
const h = crypto.createHash('md5');
1719
h.update(string);
@@ -67,7 +69,7 @@ class EngineInstaller {
6769
throw new Error(`Got ${r.status}`);
6870
}
6971
const rURL = new URL(r.url);
70-
const l = path.join(os.tmpdir(), hash(url) + path.extname(rURL.pathname));
72+
const l = path.join(os.tmpdir(), DL_FILE_PREFIX + hash(url) + path.extname(rURL.pathname));
7173
const sink = fs.createWriteStream(l);
7274
const progress = logger.progress(+r.headers.get('content-length'));
7375
await new Promise((resolve, reject) => {
@@ -176,6 +178,9 @@ class EngineInstaller {
176178
}
177179
});
178180
});
181+
if (files.length === 0) {
182+
throw new Error(`No files matched ${pattern}`);
183+
}
179184
await Promise.all(files.map((file) =>
180185
this.registerAsset(path.relative(this.extractedPath, file))));
181186
}

0 commit comments

Comments
 (0)