nw-builder 4.17.3 → 4.17.5
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/bld.js +18 -16
- package/src/util.js +1 -1
package/package.json
CHANGED
package/src/bld.js
CHANGED
|
@@ -131,13 +131,15 @@ async function bld({
|
|
|
131
131
|
await fs.promises.cp(nwDir, outDir, { recursive: true, verbatimSymlinks: true });
|
|
132
132
|
|
|
133
133
|
const files = await util.globFiles({ srcDir, glob });
|
|
134
|
-
let manifest = await util.getNodeManifest({ srcDir, glob });
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
const nwProjectDir = path.resolve(
|
|
136
|
+
outDir,
|
|
137
|
+
platform !== 'osx'
|
|
138
|
+
? 'package.nw'
|
|
139
|
+
: 'nwjs.app/Contents/Resources/app.nw',
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
await fs.promises.mkdir(nwProjectDir, { recursive: true });
|
|
141
143
|
|
|
142
144
|
if (glob) {
|
|
143
145
|
for (let file of files) {
|
|
@@ -148,10 +150,7 @@ async function bld({
|
|
|
148
150
|
await fs.promises.cp(
|
|
149
151
|
file,
|
|
150
152
|
path.resolve(
|
|
151
|
-
|
|
152
|
-
platform !== 'osx'
|
|
153
|
-
? 'package.nw'
|
|
154
|
-
: 'nwjs.app/Contents/Resources/app.nw',
|
|
153
|
+
nwProjectDir,
|
|
155
154
|
file,
|
|
156
155
|
),
|
|
157
156
|
{ recursive: true, force: true },
|
|
@@ -161,23 +160,26 @@ async function bld({
|
|
|
161
160
|
await fs.promises.cp(
|
|
162
161
|
files,
|
|
163
162
|
path.resolve(
|
|
164
|
-
|
|
165
|
-
platform !== 'osx'
|
|
166
|
-
? 'package.nw'
|
|
167
|
-
: 'nwjs.app/Contents/Resources/app.nw',
|
|
163
|
+
nwProjectDir,
|
|
168
164
|
),
|
|
169
165
|
{ recursive: true, verbatimSymlinks: true },
|
|
170
166
|
);
|
|
171
167
|
}
|
|
172
168
|
|
|
173
|
-
|
|
169
|
+
const builtManifest = JSON.parse(await fs.promises.readFile(path.resolve(nwProjectDir, 'package.json'), 'utf8'));
|
|
170
|
+
|
|
171
|
+
/* Set `product_string` in manifest for MacOS. This is used in renaming the Helper apps. */
|
|
172
|
+
if (platform === 'osx') {
|
|
173
|
+
builtManifest.product_string = app.name;
|
|
174
|
+
await fs.promises.writeFile(path.resolve(nwProjectDir, 'package.json'), JSON.stringify(builtManifest, null, 2));
|
|
175
|
+
}
|
|
174
176
|
|
|
175
177
|
if (
|
|
176
178
|
managedManifest === true ||
|
|
177
179
|
typeof managedManifest === 'object' ||
|
|
178
180
|
typeof managedManifest === 'string'
|
|
179
181
|
) {
|
|
180
|
-
await manageManifest({ nwPkg:
|
|
182
|
+
await manageManifest({ nwPkg: builtManifest, managedManifest, outDir, platform });
|
|
181
183
|
}
|
|
182
184
|
|
|
183
185
|
if (platform === 'linux') {
|
package/src/util.js
CHANGED
|
@@ -539,7 +539,7 @@ export const validate = async (options, releaseInfo) => {
|
|
|
539
539
|
if (typeof options.app.NSHumanReadableCopyright !== 'string') {
|
|
540
540
|
throw new Error('Expected options.app.NSHumanReadableCopyright to be a string. Got ' + options.app.NSHumanReadableCopyright);
|
|
541
541
|
}
|
|
542
|
-
if (typeof options.app.NSLocalNetworkUsageDescription !== 'string') {
|
|
542
|
+
if (options.app.NSLocalNetworkUsageDescription && typeof options.app.NSLocalNetworkUsageDescription !== 'string') {
|
|
543
543
|
throw new Error('Expected options.app.NSLocalNetworkUsageDescription to be a string. Got ' + options.app.NSLocalNetworkUsageDescription);
|
|
544
544
|
}
|
|
545
545
|
} else {
|