🔧 Fix various typos, implement feedback

This commit is contained in:
Felix Rieseberg 2018-01-31 16:52:38 -08:00
parent b49a284ccf
commit 1184eca581

View file

@ -15,7 +15,7 @@ Snapcraft is the primary way to get your application into the Ubuntu Software
Center, but the underlying [Snap Store](snapcraft-store) supports all major Center, but the underlying [Snap Store](snapcraft-store) supports all major
Linux distributions, too. Linux distributions, too.
There are two ways to create a `.snap` file: There are three ways to create a `.snap` file:
1) Using `electron-installer-snap`, which takes `electron-packager's` output 1) Using `electron-installer-snap`, which takes `electron-packager's` output
2) Using an already created `.deb` package 2) Using an already created `.deb` package
@ -24,7 +24,7 @@ There are two ways to create a `.snap` file:
support out of the box (not further documented here, please see those support out of the box (not further documented here, please see those
frameworks for further guidance) frameworks for further guidance)
In both cases, you will need to have the `snapcraft` tool installed. We In all cases, you will need to have the `snapcraft` tool installed. We
recommend building on Ubuntu 16.04 (or the current LTS). recommend building on Ubuntu 16.04 (or the current LTS).
```sh ```sh
@ -33,7 +33,7 @@ snap install snapcraft --classic
While it _is possible_ to install `snapcraft` on macOS using Homebrew, you are While it _is possible_ to install `snapcraft` on macOS using Homebrew, you are
less likely to encounter issues when running `snapcraft` on an actual Linux less likely to encounter issues when running `snapcraft` on an actual Linux
distribution. distribution. As of today, it is not able ot build `snap` packages, for instance.
# Using `electron-installer-snap` # Using `electron-installer-snap`
@ -46,7 +46,7 @@ npm install --save-dev electron-installer-snap
## Step 1: Package Your Electron Application ## Step 1: Package Your Electron Application
Package the application using [electron-packager][electron-packager] (or a Package the application using [electron-packager](electron-packager) (or a
similar tool). Make sure to remove `node_modules` that you don't need in your similar tool). Make sure to remove `node_modules` that you don't need in your
final application, since any module you don't actually need will just increase final application, since any module you don't actually need will just increase
your application's size. your application's size.
@ -54,33 +54,27 @@ your application's size.
The output should look roughly like this: The output should look roughly like this:
```text ```text
├── Ghost.exe .
├── LICENSE └── dist
├── content_resources_200_percent.pak └── app-linux-x64
├── content_shell.pak ├── LICENSE
├── d3dcompiler_47.dll ├── LICENSES.chromium.html
├── ffmpeg.dll ├── content_shell.pak
├── icudtl.dat ├── app
├── libEGL.dll ├── icudtl.dat
├── libGLESv2.dll ├── libgcrypt.so.11
├── locales ├── libnode.so
│   ├── am.pak ├── locales
│   ├── ar.pak ├── natives_blob.bin
│   ├── [...] ├── resources
├── natives_blob.bin ├── snapshot_blob.bin
├── node.dll └── version
├── resources
│   ├── app
│   └── atom.asar
├── snapshot_blob.bin
├── squirrel.exe
└── ui_resources_200_percent.pak
``` ```
## Step 2: Running electron-installer-snap ## Step 2: Running `electron-installer-snap`
From a terminal that has `snapcraft` in its `PATH`, run `electron-installer-snap` From a terminal that has `snapcraft` in its `PATH`, run `electron-installer-snap`
with the only required parameter `--out`, which is the location of your packaged with the only required parameter `--src`, which is the location of your packaged
Electron application created in the first step. Electron application created in the first step.
```sh ```sh
@ -88,7 +82,7 @@ npx electron-installer-snap --src=out/myappname-linux-x64
``` ```
If you have an existing build pipeline, you can use `electron-installer-snap` If you have an existing build pipeline, you can use `electron-installer-snap`
programmatically. For more information, see the API docs. programmatically. For more information, see the [API docs](snapcraft-syntax).
```js ```js
const snap = require('electron-installer-snap') const snap = require('electron-installer-snap')
@ -109,13 +103,14 @@ building blocks.
If you do not already have a `.deb` package, using `electron-installer-snap` If you do not already have a `.deb` package, using `electron-installer-snap`
might be an easier path to create snap packages. However, multiple solutions might be an easier path to create snap packages. However, multiple solutions
for creating Debian packages exist, including [`electron-forge`](electron-forge), for creating Debian packages exist, including [`electron-forge`](electron-forge),
[`electron-builder`]() or [`electron-installer-debian`](electron-installer-debian). [`electron-builder`](electron-builder) or
[`electron-installer-debian`](electron-installer-debian).
## Step 2: Create a snapcraft.yaml ## Step 2: Create a snapcraft.yaml
For more information on the available configuration options, see the For more information on the available configuration options, see the
[documentation on the snapcraft syntax](https://docs.snapcraft.io/build-snaps/syntax). [documentation on the snapcraft syntax](https://docs.snapcraft.io/build-snaps/syntax).
In this example Let's look at an example:
```yaml ```yaml
name: myApp name: myApp
@ -176,6 +171,7 @@ exec "$@" --executed-from="$(pwd)" --pid=$$ > /dev/null 2>&1 &
[snapcraft.io]: https://snapcraft.io/ [snapcraft.io]: https://snapcraft.io/
[snapcraft-store]: https://snapcraft.io/store/ [snapcraft-store]: https://snapcraft.io/store/
[snapcraft-syntax]: https://docs.snapcraft.io/build-snaps/syntax [snapcraft-syntax]: https://docs.snapcraft.io/build-snaps/syntax
[electron-packager]: https://github.com/electron-userland/electron-packager
[electron-forge]: https://github.com/electron-userland/electron-forge [electron-forge]: https://github.com/electron-userland/electron-forge
[electron-builder]: https://github.com/electron-userland/electron-builder [electron-builder]: https://github.com/electron-userland/electron-builder
[electron-installer-debian]: https://github.com/unindented/electron-installer-debian [electron-installer-debian]: https://github.com/unindented/electron-installer-debian