prefer sh to bash in the docs

This commit is contained in:
Charles Kerr 2017-11-24 11:13:57 +01:00
parent c18afc924b
commit 1b0c1842ca
16 changed files with 87 additions and 81 deletions

View file

@ -16,7 +16,7 @@ Follow the guidelines below for building Electron on Linux.
On Ubuntu, install the following libraries:
```bash
```sh
$ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \
libnotify-dev libgnome-keyring-dev libgconf2-dev \
libasound2-dev libcap-dev libcups2-dev libxtst-dev \
@ -26,7 +26,7 @@ $ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \
On RHEL / CentOS, install the following libraries:
```bash
```sh
$ sudo yum install clang dbus-devel gtk2-devel libnotify-devel \
libgnome-keyring-devel xorg-x11-server-utils libcap-devel \
cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \
@ -35,7 +35,7 @@ $ sudo yum install clang dbus-devel gtk2-devel libnotify-devel \
On Fedora, install the following libraries:
```bash
```sh
$ sudo dnf install clang dbus-devel gtk2-devel libnotify-devel \
libgnome-keyring-devel xorg-x11-server-utils libcap-devel \
cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \
@ -47,7 +47,7 @@ managers such as pacman. Or one can compile from source code.
## Getting the Code
```bash
```sh
$ git clone https://github.com/electron/electron
```
@ -58,7 +58,7 @@ the build project files. You must have Python 2.7.x for the script to succeed.
Downloading certain files can take a long time. Notice that we are using
`ninja` to build Electron so there is no `Makefile` generated.
```bash
```sh
$ cd electron
$ ./script/bootstrap.py --verbose
```
@ -68,14 +68,14 @@ $ ./script/bootstrap.py --verbose
If you want to build for an `arm` target you should also install the following
dependencies:
```bash
```sh
$ sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross \
g++-arm-linux-gnueabihf
```
Similarly for `arm64`, install the following:
```bash
```sh
$ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
g++-aarch64-linux-gnu
```
@ -83,7 +83,7 @@ $ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
And to cross-compile for `arm` or `ia32` targets, you should pass the
`--target_arch` parameter to the `bootstrap.py` script:
```bash
```sh
$ ./script/bootstrap.py -v --target_arch=arm
```
@ -91,7 +91,7 @@ $ ./script/bootstrap.py -v --target_arch=arm
If you would like to build both `Release` and `Debug` targets:
```bash
```sh
$ ./script/build.py
```
@ -100,7 +100,7 @@ the directory `out/R`. The file size is in excess of 1.3 gigabytes. This
happens because the Release target binary contains debugging symbols.
To reduce the file size, run the `create-dist.py` script:
```bash
```sh
$ ./script/create-dist.py
```
@ -110,7 +110,7 @@ may want to remove the 1.3+ gigabyte binary which is still in `out/R`.
You can also build the `Debug` target only:
```bash
```sh
$ ./script/build.py -c D
```
@ -120,13 +120,13 @@ After building is done, you can find the `electron` debug binary under `out/D`.
To clean the build files:
```bash
```sh
$ npm run clean
```
To clean only `out` and `dist` directories:
```bash
```sh
$ npm run clean-build
```
@ -139,7 +139,7 @@ $ npm run clean-build
Prebuilt `clang` will try to link to `libtinfo.so.5`. Depending on the host
architecture, symlink to appropriate `libncurses`:
```bash
```sh
$ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5
```
@ -161,19 +161,19 @@ To avoid using the prebuilt binaries of `libchromiumcontent`, you can build `lib
2. Install [additional build dependencies](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md#Install-additional-build-dependencies)
3. Fetch the git submodules:
```bash
```sh
$ git submodule update --init --recursive
```
4. Pass the `--build_release_libcc` switch to `bootstrap.py` script:
```bash
```sh
$ ./script/bootstrap.py -v --build_release_libcc
```
Note that by default the `shared_library` configuration is not built, so you can
only build `Release` version of Electron if you use this mode:
```bash
```sh
$ ./script/build.py -c R
```
@ -188,7 +188,7 @@ in `<path>/bin/`.
For example if you installed `clang` under `/user/local/bin/clang`:
```bash
```sh
$ ./script/bootstrap.py -v --build_release_libcc --clang_dir /usr/local
$ ./script/build.py -c R
```
@ -201,7 +201,7 @@ variables to the ones you want.
For example building with GCC toolchain:
```bash
```sh
$ env CC=gcc CXX=g++ ./script/bootstrap.py -v --build_release_libcc --disable_clang
$ ./script/build.py -c R
```

View file

@ -29,7 +29,7 @@ DMG.
Then, assuming that the Xcode 6.4 DMG has been mounted at `/Volumes/Xcode` and
that your Xcode 8.2.1 install is at `/Applications/Xcode.app`, run:
```bash
```sh
cp -r /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
```
@ -41,7 +41,7 @@ You will also need to enable Xcode to build against the 10.10 SDK:
## Getting the Code
```bash
```sh
$ git clone https://github.com/electron/electron
```
@ -51,7 +51,7 @@ The bootstrap script will download all necessary build dependencies and create
the build project files. Notice that we're using [ninja](https://ninja-build.org/)
to build Electron so there is no Xcode project generated.
```bash
```sh
$ cd electron
$ ./script/bootstrap.py -v
```
@ -60,13 +60,13 @@ $ ./script/bootstrap.py -v
Build both `Release` and `Debug` targets:
```bash
```sh
$ ./script/build.py
```
You can also only build the `Debug` target:
```bash
```sh
$ ./script/build.py -c D
```
@ -81,13 +81,13 @@ support 32bit macOS in the future.
To clean the build files:
```bash
```sh
$ npm run clean
```
To clean only `out` and `dist` directories:
```bash
```sh
$ npm run clean-build
```

View file

@ -88,7 +88,7 @@ $ npm run clean
To clean only `out` and `dist` directories:
```bash
```sh
$ npm run clean-build
```
@ -114,7 +114,7 @@ Make sure you have the latest Visual Studio update installed.
If building under Cygwin, you may see `bootstrap.py` failed with following
error:
```bash
```sh
Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430
Traceback (most recent call last):

View file

@ -47,7 +47,7 @@ can switch the download address to it via
If you only want to build Electron quickly for testing or development, you
can download just the shared library versions by passing the `--dev` parameter:
```bash
```sh
$ ./script/bootstrap.py --dev
$ ./script/build.py -c D
```
@ -76,20 +76,20 @@ you are not affected.
Test your changes conform to the project coding style using:
```bash
```sh
$ npm run lint
```
Test functionality using:
```bash
```sh
$ npm test
```
Whenever you make changes to Electron source code, you'll need to re-run the
build before the tests:
```bash
```sh
$ npm run build && npm test
```
@ -117,6 +117,6 @@ details), but they will work with the release build.
To run the tests with the release build use:
```bash
```sh
$ npm test -- -R
```

View file

@ -26,7 +26,7 @@ to enable step-through debugging with breakpoints inside Electron's source code.
To start a debugging session, open up Terminal and start `lldb`, passing a debug
build of Electron as a parameter.
```bash
```sh
$ lldb ./out/D/Electron.app
(lldb) target create "./out/D/Electron.app"
Current executable set to './out/D/Electron.app' (x86_64).
@ -47,20 +47,20 @@ Let's assume that you want to debug `app.setName()`, which is defined in `browse
as `Browser::SetName()`. Set the breakpoint using the `breakpoint` command, specifying
file and line to break on:
```bash
```sh
(lldb) breakpoint set --file browser.cc --line 117
Breakpoint 1: where = Electron Framework`atom::Browser::SetName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 20 at browser.cc:118, address = 0x000000000015fdb4
```
Then, start Electron:
```bash
```sh
(lldb) run
```
The app will immediately be paused, since Electron sets the app's name on launch:
```bash
```sh
(lldb) run
Process 25244 launched: '/Users/fr/Code/electron/out/D/Electron.app/Contents/MacOS/Electron' (x86_64)
Process 25244 stopped
@ -79,7 +79,7 @@ Process 25244 stopped
To show the arguments and local variables for the current frame, run `frame variable` (or `fr v`),
which will show you that the app is currently setting the name to "Electron".
```bash
```sh
(lldb) frame variable
(atom::Browser *) this = 0x0000000108b14f20
(const string &) name = "Electron": {
@ -91,7 +91,7 @@ To do a source level single step in the currently selected thread, execute `step
This would take you into `name_override_.empty()`. To proceed and do a step over,
run `next` (or `n`).
```bash
```sh
(lldb) step
Process 25244 stopped
* thread #1: tid = 0x839a4c, 0x0000000100162dcc Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name="Electron") + 44 at browser.cc:119, queue = 'com.apple.main-thread', stop reason = step in

View file

@ -14,29 +14,35 @@ on each Chromium upgrade in Electron.
### Steps
### 1. Get the code and initialize the project:
```sh
$ git clone git@github.com:electron/libchromiumcontent.git
$ cd libchromiumcontent
$ ./script/bootstrap -v
```
### 2. Find the new beta/stable Chromium version from [OmahaProxy](https://omahaproxy.appspot.com/).
### 3. Put it into the `libchromiumcontent/VERSION` file, then run `$ ./script/update`
- It will probably fail applying patches.
### 4. Fix `*.patch` files in the `/patches` and `/patches-mas` folders.
### 5. (Optional) Run a separate script to apply patches (`script/update` uses it internally):
```sh
$ git clone git@github.com:electron/libchromiumcontent.git
$ cd libchromiumcontent
$ ./script/bootstrap -v
```
### 2. Update the Chromium snapshot
- Choose a version number from [OmahaProxy](https://omahaproxy.appspot.com/) and update the `VERSION` file with it
- This can be done manually by visiting OmahaProxy in a browser, or automatically:
- One-liner for the latest stable mac version: `curl -so- https://omahaproxy.appspot.com/mac > VERSION`
- One-liner for the latest win64 beta version: `curl -so- https://omahaproxy.appspot.com/all | grep "win64,beta" | awk -F, 'NR==1{print $3}' > VERSION`
- run `$ ./script/update`
- Time to brew some tea -- this may run for 30m or more.
- It will probably fail applying patches.
### 3. Fix `*.patch` files in the `/patches` and `/patches-mas` folders.
### 4. (Optional) Run a separate script to apply patches (`script/update` uses it internally):
```sh
$ ./script/apply-patches
```
- There is also another script `/script/patch.py` that could be more useful, check `--help` to learn how it works with `$ ./script/patch.py -h`
### 6. Run the build when all patches can be applied without errors
### 5. Run the build when all patches can be applied without errors
```sh
$ ./script/build
```
- If some patches are no longer compatible with the Chromium code, fix compilation errors.
### 7. When build succeeds, create a `dist` for Electron
### 6. When build succeeds, create a `dist` for Electron
`$ ./script/create-dist --no_zip`
- It will create `dist/main` folder in the root of the libcc repo, you will need it to build Electron.
### 8. (Optional) Update script contents if there are errors resultant of some files being removed or renamed. (`--no_zip` prevents script from create `dist` archives, you don't need them.)
### 7. (Optional) Update script contents if there are errors resultant of some files being removed or renamed. (`--no_zip` prevents script from create `dist` archives, you don't need them.)
## Update Electron Code