@@ -40,31 +40,41 @@ docker compose up -d
Once you have the dependencies installed, you can build Zed using [Cargo](https://doc.rust-lang.org/cargo/).
-For a debug build:
+For a debug build of the editor:
```
cargo run
```
-For a release build:
+And to run the tests:
```
-cargo run --release
+cargo test --workspace
```
-For a release package:
+In release mode, the primary user interface is the `cli` crate. You can run it in development with:
```
-cargo build --release
+cargo run -p cli
```
-the binary can be found in `target/release` folder.
+## Installing a development build
-And to run the tests:
+You can install a local build on your machine with:
```
-cargo test --workspace
+./script/install-linux
+```
+
+This will build zed and the cli in release mode and make them available at `~/.local/bin/zed`, installing .desktop files to `~/.local/share`.
+
+If you'd like to install things to a different prefix you can use:
+
```
+./script/install-linux /usr/
+```
+
+In this case the binary will be `/usr/bin/zed` and the `.desktop` file in `/usr/share`. The script should prompt for sudo as required so that the rust build runs as the current user.
## Wayland & X11
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+set -euxo pipefail
+
+if [[ $# -gt 0 ]]; then
+ echo "
+ Usage: ${0##*/}
+ Builds and installs zed onto your system into ~/.local, making it available as ~/.local/bin/zed.
+
+ Before running this you should ensure you have all the build dependencies installed with `./script/linux`.
+ "
+ exit 1
+fi
+export ZED_CHANNEL=$(<crates/zed/RELEASE_CHANNEL)
+export ZED_UPDATE_EXPLANATION="You need to fetch and rebuild zed in $(pwd)"
+script/bundle-linux
+
+target="linux-$(uname -m)"
+commit=$(git rev-parse HEAD | cut -c 1-7)
+if [[ "$ZED_CHANNEL" == "dev" ]]; then
+ archive="zed-${commit}-${target}.tar.gz"
+else
+ archive="zed-${target}.tar.gz"
+fi
+export ZED_BUNDLE_PATH="target/release/${archive}"
+script/install.sh