nw-builder 4.13.15 → 4.13.16
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.
- package/package.json +1 -1
- package/src/util.js +7 -7
package/package.json
CHANGED
package/src/util.js
CHANGED
|
@@ -10,10 +10,10 @@ import semver from 'semver';
|
|
|
10
10
|
/**
|
|
11
11
|
* Get manifest (array of NW release metadata) from URL.
|
|
12
12
|
* @param {string} manifestUrl Url to manifest
|
|
13
|
-
* @returns {Promise<
|
|
13
|
+
* @returns {Promise<string>} - Manifest object
|
|
14
14
|
*/
|
|
15
15
|
function getManifest(manifestUrl) {
|
|
16
|
-
let chunks =
|
|
16
|
+
let chunks = '';
|
|
17
17
|
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
19
|
const req = https.get(manifestUrl, (response) => {
|
|
@@ -23,7 +23,7 @@ function getManifest(manifestUrl) {
|
|
|
23
23
|
|
|
24
24
|
response.on('error', (e) => {
|
|
25
25
|
console.error(e);
|
|
26
|
-
resolve(
|
|
26
|
+
resolve('');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
response.on('end', () => {
|
|
@@ -32,7 +32,7 @@ function getManifest(manifestUrl) {
|
|
|
32
32
|
});
|
|
33
33
|
req.on('error', (e) => {
|
|
34
34
|
console.error(e);
|
|
35
|
-
resolve(
|
|
35
|
+
resolve('');
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -63,11 +63,11 @@ async function getReleaseInfo(
|
|
|
63
63
|
|
|
64
64
|
try {
|
|
65
65
|
const data = await getManifest(manifestUrl);
|
|
66
|
-
if (data
|
|
67
|
-
await fs.promises.writeFile(manifestPath, data
|
|
66
|
+
if (data.length) {
|
|
67
|
+
await fs.promises.writeFile(manifestPath, data);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
const manifest = JSON.parse(await fs.promises.readFile(manifestPath));
|
|
71
71
|
if (version === 'latest' || version === 'stable' || version === 'lts') {
|
|
72
72
|
// Remove leading "v" from version string
|
|
73
73
|
version = manifest[version].slice(1);
|