Skip to content

Commit

Permalink
docs: clarify CLI usage
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Jul 17, 2023
1 parent 6cdd96b commit d29a94f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,26 @@ via [Homebrew](https://brew.sh/).

## Usage

### Via JavaScript

JavaScript API usage can be found in the [API documentation](https://electron.github.io/electron-packager/main/modules/electronpackager.html).

### From the Command Line
### From the command line

Running Electron Packager from the command line has this basic form:

```
npx electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]
```

**Note**: `npx` can be substituted for `yarn` or `npm exec` depending on what package manager and
the version you have installed.
> **Note**:
> `npx` can be substituted for `yarn` or `npm exec` depending on what package manager and
> the version you have installed.
This will:

- Find or download the correct release of Electron
- Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>` *(this can be customized via an optional flag)*
* Find or download the correct release of Electron
* Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>` *(this can be customized via an optional flag)*

`--platform` and `--arch` can be omitted, in two cases:

Expand All @@ -100,6 +103,13 @@ For an overview of the other optional flags, run `electron-packager --help` or s
[usage.txt](https://github.com/electron/electron-packager/blob/main/usage.txt). For
detailed descriptions, see the [API documentation](https://electron.github.io/electron-packager/main/modules/electronpackager.html).

For flags that are structured as objects, you can pass each option as via dot notation as such:

```sh
npx electron-packager --flag.foo="bar"
# will pass in { flag: { foo: "bar"} } as an option to the Electron Packager API
```

If `appname` is omitted, this will use the name specified by "productName" or "name" in the nearest package.json.

**Characters in the Electron app name which are not allowed in all target platforms' filenames
Expand Down

0 comments on commit d29a94f

Please sign in to comment.