Fix download after changes on the github site.

This commit is contained in:
Volker Berlin 2022-09-28 19:45:22 +02:00
parent 4a802a8b15
commit 4c262a2ad1
No known key found for this signature in database
GPG Key ID: 988423EF815BE4CB

View File

@ -63,7 +63,7 @@ class Wat2Wasm {
throw new IllegalStateException( "Unknown OS: " + os );
}
URL url = new URL( "https://github.com/WebAssembly/wabt/releases/latest" );
URL url = new URL( "https://api.github.com/repos/WebAssembly/wabt/releases/latest" );
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
InputStream input = conn.getInputStream();
String data = WasmRule.readStream( input, true );
@ -72,7 +72,7 @@ class Wat2Wasm {
Matcher matcher = pattern.matcher( data );
Assert.assertTrue( data, matcher.find() );
String downloadUrl = matcher.group();
url = new URL( url, downloadUrl );
url = new URL( "https://github.com" + downloadUrl );
System.out.println( "\tDownload: " + url );
conn = (HttpURLConnection)url.openConnection();