File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,21 @@ async function getLatestRdflintVersion(): Promise<string> {
8
8
const response = await fetch (
9
9
'https://jitpack.io/api/builds/com.github.imas/rdflint/latestOk'
10
10
) ;
11
+
12
+ if ( ! response . ok ) {
13
+ throw new Error (
14
+ `Failed to get the latest rdflint version: ${ response . status } ${ response . statusText } `
15
+ ) ;
16
+ }
17
+
11
18
const { version } = await response . json ( ) ;
12
19
13
20
if ( typeof version !== 'string' ) {
14
- throw new Error ( 'Failed to get the latest rdflint version' ) ;
21
+ throw new Error (
22
+ 'Failed to get the latest rdflint version: Unexpected version format'
23
+ ) ;
15
24
}
25
+
16
26
return version ;
17
27
}
18
28
@@ -27,11 +37,10 @@ async function installRdflint(version: string): Promise<string> {
27
37
version
28
38
) ;
29
39
40
+ const jarPath = path . join ( cachePath , 'rdflint.jar' ) ;
30
41
const executablePath = path . join ( cachePath , 'rdflint' ) ;
31
- fs . writeFileSync (
32
- executablePath ,
33
- `#!/bin/sh\njava -jar ${ cachePath } /rdflint.jar $@`
34
- ) ;
42
+
43
+ fs . writeFileSync ( executablePath , `#!/bin/sh\njava -jar ${ jarPath } $@` ) ;
35
44
fs . chmodSync ( executablePath , 0o555 ) ;
36
45
37
46
return cachePath ;
You can’t perform that action at this time.
0 commit comments