Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): correct Windows install script; simplify GitHub links in logging #156

Merged
merged 4 commits into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@

# **Installation**

The easiest way to install `gdenv` is by using the pre-built binaries. These can be manually downloaded and configured, but automated installation scripts are provided and recommended.

Alternatively, you can install `gdenv` from source using the latest supported version of [Go](https://go.dev/). See [Install from source](#install-from-source) for more details.

## **Pre-built binaries**
## **Pre-built binaries (recommended)**

> ⚠️ **WARNING:** It's good practice to inspect an installation script prior to execution. The scripts are included in this repository and can be reviewed prior to use.

### **Linux/MacOS (recommended)**
### **Linux/MacOS**

```sh
curl https://raw.githubusercontent.com/coffeebeats/gdenv/main/scripts/install.sh | sh
```

### **Windows (recommended)**
### **Windows**

#### **Git BASH for Windows**

If you're using [Git BASH for Windows](https://gitforwindows.org/) follow the recommended [Linux/MacOS](#linuxmacos-recommended) instructions.
If you're using [Git BASH for Windows](https://gitforwindows.org/) follow the recommended [Linux/MacOS](#linuxmacos) instructions.

#### **Powershell**

Expand All @@ -35,34 +34,32 @@ Invoke-WebRequest `
-UseBasicParsing `
-Uri "https://raw.githubusercontent.com/coffeebeats/gdenv/main/scripts/install.ps1" `
-OutFile "./install-gdenv.ps1"; `
&"./scripts/install-gdenv.ps1"
&"./install-gdenv.ps1"; `
Remove-Item "./install-gdenv.ps1"
```

### **Manual download**

> ❕ **NOTE:** The instructions below provide `bash`-specific commands for a _Linux_-based system. While these won't work in _PowerShell_, the process will be similar.
> ❕ **NOTE:** The instructions below provide `bash`-specific commands for a _Linux_-based system. While these won't work in _Powershell_, the process will be similar.

1. Download a prebuilt binary from the corresponding GitHub release.
1. Download a prebuilt binary from the corresponding GitHub release. Set `VERSION`, `OS`, and `ARCH` to the desired values.

```sh
# Set '$VERSION', '$OS', and '$ARCH' to the desired values.
VERSION=0.0.0 OS=linux ARCH=x86_64; \
curl -LO https://github.com/coffeebeats/gdenv/releases/download/v$VERSION/gdenv-$VERSION-$OS-$ARCH.tar.gz
```

2. Extract the downloaded archive.
2. Extract the downloaded archive. To customize the `gdenv` install location, set `GDENV_HOME` to the desired location (defaults to `$HOME/.gdenv` on Linux/MacOS).

```sh
# Set '$GDENV_HOME' to the desired location (defaults to '$HOME/.gdenv' on Linux/MacOS).
GDENV_HOME=$HOME/.gdenv; \
mkdir -p $GDENV_HOME/bin && \
tar -C $GDENV_HOME/bin -xf gdenv-$VERSION-$OS-$ARCH.tar.gz
```

3. Export the `GDENV_HOME` environment variable and add `$GDENV_HOME/bin` to `$PATH`.
3. Export the `GDENV_HOME` environment variable and add `$GDENV_HOME/bin` to `PATH`. Add the following to your shell profile script (e.g. in `.bashrc`, `.zshenv`, `.profile`, or something similar).

```sh
# In '.bashrc' or something similar ('$GDENV_HOME' can be customized).
export GDENV_HOME="$HOME/.gdenv"
export PATH="$GDENV_HOME/bin:$PATH"
```
Expand Down