nw 0.88.0-3-sdk → 0.88.0-4-sdk
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/parse.js +3 -20
package/package.json
CHANGED
package/src/parse.js
CHANGED
|
@@ -24,8 +24,8 @@ import util from '../src/util.js';
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Parse options.
|
|
27
|
-
*
|
|
28
|
-
* @param {ParseOptions} options
|
|
27
|
+
*
|
|
28
|
+
* @param {ParseOptions} options
|
|
29
29
|
* @return {Promise<ParseOptions>}
|
|
30
30
|
*/
|
|
31
31
|
export default async function parse(options) {
|
|
@@ -45,27 +45,10 @@ export default async function parse(options) {
|
|
|
45
45
|
parsedVersion.minor,
|
|
46
46
|
parsedVersion.patch
|
|
47
47
|
].join('.');
|
|
48
|
-
|
|
49
48
|
options.flavor = options.flavor || process.env.npm_config_nwjs_build_type || process.env.NWJS_BUILD_TYPE || 'normal';
|
|
50
|
-
|
|
51
|
-
/* Check if version is a prelease. */
|
|
52
|
-
if (typeof parsedVersion?.prerelease?.[0] === 'string') {
|
|
53
|
-
let prerelease = parsedVersion.prerelease[0].split('-');
|
|
54
|
-
if (prerelease.length > 1) {
|
|
55
|
-
prerelease = prerelease.slice(0, -1);
|
|
56
|
-
}
|
|
57
|
-
options.version = [options.version, ...prerelease].join('-');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Check build flavor and slice that off the `version`. */
|
|
61
|
-
if (options.version.endsWith('-sdk')) {
|
|
62
|
-
options.version = options.version.slice(0, -4);
|
|
63
|
-
options.flavor = 'sdk';
|
|
64
|
-
} else if (options.version.endsWith('sdk')) {
|
|
65
|
-
options.version = version.slice(0, -3);
|
|
49
|
+
if (parsedVersion?.prerelease[0]?.endsWith('sdk')) {
|
|
66
50
|
options.flavor = 'sdk';
|
|
67
51
|
}
|
|
68
|
-
|
|
69
52
|
options.platform = options.platform || util.PLATFORM_KV[process.env.npm_config_nwjs_platform || process.env.NWJS_PLATFORM || process.platform];
|
|
70
53
|
options.arch = options.arch || util.ARCH_KV[process.env.npm_config_nwjs_process_arch || process.env.NWJS_ARCH || process.arch];
|
|
71
54
|
options.downloadUrl = options.downloadUrl || process.env.npm_config_nwjs_urlbase || process.env.NWJS_URLBASE || 'https://dl.nwjs.io';
|