nw-builder 4.13.0 → 4.13.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "4.13.0",
3
+ "version": "4.13.2",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
package/src/bld.js CHANGED
@@ -143,7 +143,11 @@ async function bld({
143
143
 
144
144
  if (glob) {
145
145
  for (let file of files) {
146
- await fs.promises.cp(
146
+ const stats = await fs.promises.stat(file);
147
+ if (stats.isDirectory()) {
148
+ continue;
149
+ }
150
+ await fs.promises.copyFile(
147
151
  file,
148
152
  path.resolve(
149
153
  outDir,
@@ -256,7 +260,7 @@ const setLinuxConfig = async ({ app, outDir }) => {
256
260
  GenericName: app.genericName,
257
261
  NoDisplay: app.noDisplay,
258
262
  Comment: app.comment,
259
- Icon: path.resolve(outDir, 'package.nw', path.basename(app.icon)),
263
+ Icon: app.icon ? path.resolve(outDir, 'package.nw', app.icon) : '',
260
264
  Hidden: app.hidden,
261
265
  OnlyShowIn: app.onlyShowIn,
262
266
  NotShowIn: app.notShowIn,
package/src/index.d.ts CHANGED
@@ -176,6 +176,6 @@ export interface OsxAppOptions {
176
176
  /**
177
177
  * Automates building an NW.js application.
178
178
  */
179
- declare function nwbuild<P extends SupportedPlatform>(options: Options<P>): Promise<void>;
179
+ declare function nwbuild<P extends SupportedPlatform>(options: Options<P>): Promise<child_process.ChildProcess | null | undefined>;
180
180
 
181
181
  export default nwbuild;
package/src/index.js CHANGED
@@ -36,7 +36,7 @@ import util from './util.js';
36
36
  * @async
37
37
  * @function
38
38
  * @param {Options} options Options
39
- * @returns {Promise<void>}
39
+ * @returns {Promise<child_process.ChildProcess | null | undefined>}
40
40
  */
41
41
  async function nwbuild(options) {
42
42
  let built;
@@ -108,12 +108,12 @@ async function nwbuild(options) {
108
108
 
109
109
  if (options.mode === 'get') {
110
110
  // Do nothing else since we have already downloaded the binaries.
111
- return;
111
+ return undefined;
112
112
  }
113
113
 
114
114
  if (options.mode === 'run') {
115
115
  util.log('info', options.logLevel, 'Running NW.js in run mode...');
116
- await run({
116
+ const nwProcess = await run({
117
117
  version: options.version,
118
118
  flavor: options.flavor,
119
119
  platform: options.platform,
@@ -123,6 +123,7 @@ async function nwbuild(options) {
123
123
  glob: options.glob,
124
124
  argv: options.argv,
125
125
  });
126
+ return nwProcess;
126
127
  } else if (options.mode === 'build') {
127
128
  util.log('info', options.logLevel, `Build a NW.js application for ${options.platform} ${options.arch}...`);
128
129
  await bld({
@@ -147,6 +148,8 @@ async function nwbuild(options) {
147
148
  console.error(error);
148
149
  throw error;
149
150
  }
151
+
152
+ return undefined;
150
153
  }
151
154
 
152
155
  export default nwbuild;
package/src/util.js CHANGED
@@ -239,7 +239,7 @@ export const parse = async (options, pkg) => {
239
239
  options.app.name = options.app.name.replace(/[<>:"/\\|?*\u0000-\u001F]/g, '');
240
240
  }
241
241
  /* Path to where the icon currently is in the filesystem */
242
- options.app.icon = options.app.icon ?? undefined;
242
+ options.app.icon = options.app.icon ?? pkg.window?.icon ?? undefined;
243
243
  if (options.app.icon) {
244
244
  options.app.icon = path.resolve(options.app.icon);
245
245
  }