jdeploy-installer-win-x64 5.5.2-dev.0 → 5.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -63,6 +63,10 @@ function njreWrap() {
63
63
  createDir(dir)
64
64
  .then(() => fetch(url))
65
65
  .then(response => {
66
+ // Validate HTTP status code before writing the file
67
+ if (!response.ok) {
68
+ return reject(new Error(`HTTP ${response.status}: ${response.statusText} for ${url}`))
69
+ }
66
70
  const destFile = path.join(dir, destName)
67
71
  const destStream = fs.createWriteStream(destFile)
68
72
  response.body.pipe(destStream).on('finish', () => resolve(destFile))
@@ -332,25 +336,12 @@ function njreWrap() {
332
336
  .then(extract);
333
337
  };
334
338
 
335
- // First, attempt to download the JRE
336
- return download(tmpdir, url)
337
- .then(response => {
338
- // If the JRE is available, proceed with the download and extraction
339
- if (response.status === 200) {
340
- return attemptDownload(url);
341
- } else {
342
- // If JRE is not available, switch to JDK
343
- console.log(`JRE not available for version ${version}, falling back to JDK...`);
344
- // Update the query to request JDK instead of JRE
345
- q.bundle_type = 'jdk'; // Switch to JDK
346
- url = zuluBaseURL;
347
- Object.keys(q).forEach(key => { url += key + '=' + q[key] + '&' });
348
- return attemptDownload(url); // Try downloading the JDK
349
- }
350
- })
339
+ // Attempt to download and extract the JRE/JDK
340
+ return attemptDownload(url)
351
341
  .catch(err => {
352
342
  console.error("Download failed: ", err);
353
- throw err; // Re-throw the error after logging
343
+ // Exit with non-zero status code to signal failure to CI/CD systems
344
+ process.exit(1);
354
345
  });
355
346
  }
356
347
 
@@ -569,7 +560,9 @@ if (!done) {
569
560
 
570
561
  run(env['JAVA_HOME']);
571
562
  }).catch(function(err) {
572
- console.log("Failed to install JRE", err);
563
+ console.error("Failed to install JRE", err);
564
+ // Exit with non-zero status code to signal failure to CI/CD systems
565
+ process.exit(1);
573
566
  });
574
567
  }
575
568
 
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "directory": "installer",
10
10
  "url": "https://github.com/shannah/jdeploy.git"
11
11
  },
12
- "version": "5.5.2-dev.0",
12
+ "version": "5.5.4",
13
13
  "jdeploy": {
14
14
  "checksums": {},
15
15
  "packageMacX64": "jdeploy-installer-mac-x64",