Skip to content

Commit 4d39f77

Browse files
committed
Unit test fix for issue #69
1 parent bde9142 commit 4d39f77

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

server/src/main/java/com/defold/extender/services/DefoldSdkService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public File getSdk(String hash) throws IOException, URISyntaxException, Extender
5959
// If directory does not exist, create it and download SDK
6060
if (!Files.exists(sdkDirectory.toPath())) {
6161
LOGGER.info("Downloading Defold SDK version {} ...", hash);
62-
Files.createDirectories(sdkDirectory.toPath());
6362

6463
URL url = new URL(String.format(REMOTE_SDK_URL_PATTERN, hash));
6564
ClientHttpRequestFactory clientHttpRequestFactory = new SimpleClientHttpRequestFactory();
@@ -70,6 +69,8 @@ public File getSdk(String hash) throws IOException, URISyntaxException, Extender
7069
if (response.getStatusCode() != HttpStatus.OK) {
7170
throw new ExtenderException(String.format("The given sdk does not exist: %s (%s)", hash, response.getStatusCode().toString()));
7271
}
72+
73+
Files.createDirectories(sdkDirectory.toPath());
7374
InputStream body = response.getBody();
7475
ZipUtils.unzip(body, sdkDirectory.toPath());
7576
}

0 commit comments

Comments
 (0)