Skip to content

Commit 9849cf5

Browse files
committed
Update dist/index.js
1 parent 14c7416 commit 9849cf5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dist/index.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -972,20 +972,23 @@ const fs = __importStar(__webpack_require__(747));
972972
const path = __importStar(__webpack_require__(622));
973973
async function getLatestRdflintVersion() {
974974
const response = await node_fetch_1.default('https://jitpack.io/api/builds/com.github.imas/rdflint/latestOk');
975+
if (!response.ok) {
976+
throw new Error(`Failed to get the latest rdflint version: ${response.status} ${response.statusText}`);
977+
}
975978
const { version } = await response.json();
976979
if (typeof version !== 'string') {
977-
throw new Error('Failed to get the latest rdflint version');
980+
throw new Error('Failed to get the latest rdflint version: Unexpected version format');
978981
}
979982
return version;
980983
}
981984
async function installRdflint(version) {
982985
const downloadUrl = `https://jitpack.io/com/github/imas/rdflint/${version}/rdflint-${version}.jar`;
983986
const downloadPath = await tc.downloadTool(downloadUrl);
984987
const cachePath = await tc.cacheFile(downloadPath, 'rdflint.jar', 'rdflint', version);
988+
const jarPath = path.join(cachePath, 'rdflint.jar');
985989
const executablePath = path.join(cachePath, 'rdflint');
986-
fs.writeFileSync(executablePath, `#!/bin/sh\njava -jar ${cachePath}/rdflint.jar $@`);
990+
fs.writeFileSync(executablePath, `#!/bin/sh\njava -jar ${jarPath} $@`);
987991
fs.chmodSync(executablePath, 0o555);
988-
core.addPath(cachePath);
989992
return cachePath;
990993
}
991994
async function run() {
@@ -999,6 +1002,7 @@ async function run() {
9991002
console.log('Installing rdflint ' + version);
10001003
rdflintPath = await installRdflint(version);
10011004
}
1005+
core.addPath(rdflintPath);
10021006
}
10031007
catch (e) {
10041008
core.setFailed(e.message);

0 commit comments

Comments
 (0)