Skip to content

Commit

Permalink
fix #716: warn about loss of file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Jan 6, 2023
1 parent 4bc6f36 commit 8793d4b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and L

> Before using `nw-builder`, please go through how to [write an NW.js application](https://nwjs.readthedocs.io/en/latest/For%20Users/Getting%20Started/).
## Install
- [Installation](https://github.com/nwutils/nw-builder#installation)
- [Usage](https://github.com/nwutils/nw-builder#usage)
- [Limitations](https://github.com/nwutils/nw-builder#limitations)
- [API Reference](https://nwutils.io/nw-builder/global#nwbuild)
- [Contributing](https://github.com/nwutils/nw-builder#contributing)
- [License](https://github.com/nwutils/nw-builder#license)

## Installation

Install `nw-builder` via `npm` or your preferred Node package manager of choice.

Expand Down Expand Up @@ -102,6 +109,10 @@ package.json usage

For more options, check out the [API reference](https://nwutils.io/nw-builder/global#nwbuild).

## Limitations

- #716 File permissions are incorrectly set for Linux or MacOS apps built on Windows platform.

## Migration to v4

### Update `nw-builder`
Expand Down
4 changes: 4 additions & 0 deletions src/bld/linuxCfg.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { platform } from "node:process";
import { rename, writeFile } from "node:fs/promises";

import { log } from "../log.js";
Expand All @@ -11,6 +12,9 @@ import { log } from "../log.js";
* @return {undefined}
*/
export const setLinuxConfig = async (app, outDir) => {
if (platform === "win32") {
log.warn("Linux apps built on Windows platform do not preserve all file permissions. See #716");
}
let desktopEntryFile = {
Type: "Application",
Version: "1.5",
Expand Down
4 changes: 4 additions & 0 deletions src/bld/osxCfg.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { platform } from "node:process";
import fs from "node:fs/promises";
import path from "node:path";

Expand All @@ -13,6 +14,9 @@ import { log } from "../log.js";
* @return {Promise<undefined>}
*/
const setOsxConfig = async (pkg, outDir) => {
if (platform === "win32") {
log.warn("MacOS apps built on Windows platform do not preserve all file permissions. See #716");
}
try {
const outApp = path.resolve(outDir, `${pkg.name}.app`);
await fs.rename(path.resolve(outDir, "nwjs.app"), outApp);
Expand Down

0 comments on commit 8793d4b

Please sign in to comment.