Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ title: Changelog

## [Unreleased](https://github.com/lets-cli/lets/releases/tag/v0.0.X)

* `[Changed]` Install script now installs to `$HOME/.lets/bin`, exposes `lets` through a user PATH symlink, and stops on old non-Homebrew `/usr/local/bin/lets` installs. Issue [#121](https://github.com/lets-cli/lets/issues/121)
* `[Fixed]` Prevent `lets self upgrade` from overwriting Homebrew-managed installs. Issue [#338](https://github.com/lets-cli/lets/issues/338)
* `[Fixed]` `lets self upgrade` now updates symlink targets and refuses common system-managed install paths.

## [0.0.60](https://github.com/lets-cli/lets/releases/tag/v0.0.60)

Expand Down
11 changes: 6 additions & 5 deletions docs/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ have stable `lets` version untouched.
To build a binary:

```bash
go build -o lets-dev *.go
go build -o lets-dev ./cmd/lets
```

To install in system
To install in your user `PATH`:

```bash
go build -o lets-dev *.go && sudo mv ./lets-dev /usr/local/bin/lets-dev
mkdir -p "$HOME/.local/bin"
go build -o "$HOME/.local/bin/lets-dev" ./cmd/lets
```

Or if you already have `lets` installed in your system:

```bash
lets build-and-install [--path=<path>]
```
`path` - your custom executable $PATH, defaults to `/usr/local/bin`
`path` - your custom executable $PATH, defaults to `$HOME/.local/bin`

After install - check version of lets - `lets-dev --version` - it should be development

It will install `lets-dev` to /usr/local/bin/lets-dev, or wherever you`ve specified in path, and set version to development with current tag and timestamp
It will install `lets-dev` to `$HOME/.local/bin/lets-dev`, or wherever you`ve specified in path, and set version to development with current tag and timestamp

## Test

Expand Down
200 changes: 119 additions & 81 deletions docs/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,159 +4,197 @@ title: Installation
sidebar_label: Installation
---

## Homebrew

### Binary
```bash
brew tap lets-cli/tap
brew install lets-cli/tap/lets
```

## Arch

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Install the latest binary release from [AUR lets-bin](https://aur.archlinux.org/packages/lets-bin/).

<Tabs
defaultValue="shell"
values={[
{ label: 'Shell', value: 'shell', },
{ label: 'Binary', value: 'binary', },
]}
>
<TabItem value="shell">
If you use `yay` as your AUR helper:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://lets-cli.org/install.sh | sh -s -- -b ~/bin
yay -S lets-bin
```

This will install **latest** `lets` binary to `~/bin` directory.
You can also install the bleeding edge version from [AUR lets-git](https://aur.archlinux.org/packages/lets-git/).

To be able to run `lets` from any place in system add `$HOME/bin` to your `PATH`
```bash
yay -S lets-git
```

Open one of these files
## Shell Script

```bash
vim ~/.profile # or vim ~/.bashrc or ~/.zshrc
curl -fsSL https://lets-cli.org/install.sh | bash
```

Add the following line at the end of file, save file and restart the shell.
This installs the **latest** `lets` binary to `$HOME/.lets/bin/lets`.

The installer will make `lets` available in your `PATH` by creating a symlink in the first existing preferred
directory from this list:

* `$HOME/.local/bin`
* `$HOME/bin`
* `$HOME/.bin`

If none of these directories are in `PATH`, the installer creates `$HOME/.local/bin`, links `lets` there, and adds
`$HOME/.local/bin` to your shell profile.

For CI and other non-interactive installs, set `LETS_INSTALL_NO_PROMPT=1` to skip shell profile prompts. When PATH
setup is needed, the installer will use the same non-interactive behavior and update the detected shell profile.

```bash
export PATH=$PATH:$HOME/bin
curl -fsSL https://lets-cli.org/install.sh | LETS_INSTALL_NO_PROMPT=1 bash
```

You can change install location to any directory you want, probably to directory that is in your $PATH

To install a specific version of `lets` (for example `v0.0.21`):

```bash
curl --proto '=https' --tlsv1.2 -sSf https://lets-cli.org/install.sh | sh -s -- v0.0.21
curl -fsSL https://lets-cli.org/install.sh | bash -s -- v0.0.21
```

To use `lets` globally in system you may want to install `lets` to `/usr/local/bin`
You can also use `LETS_VERSION`. If both `LETS_VERSION` and a positional version are provided, `LETS_VERSION` wins.

```bash
curl -fsSL https://lets-cli.org/install.sh | LETS_VERSION=v0.0.21 bash
```

> May require `sudo`
To install into a custom lets home directory, set `LETS_HOME`. The binary will be installed to `$LETS_HOME/bin/lets`.

```bash
curl --proto '=https' --tlsv1.2 -sSf https://lets-cli.org/install.sh | sh -s -- -b /usr/local/bin
curl -fsSL https://lets-cli.org/install.sh | LETS_HOME=$HOME/tools/lets bash
```

</TabItem>
<TabItem value='binary'>
## Binary (Manual)

Download the version you need for your platform from [Lets Releases](https://github.com/lets-cli/lets/releases).

Once downloaded, the binary can be run from anywhere.

Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/bin` is the most probable location.
Ideally, install it somewhere in your user `PATH`, such as `$HOME/.local/bin`.

</TabItem>
</Tabs>
## GitHub Action

Use [lets-cli/lets-action](https://github.com/lets-cli/lets-action) in a GitHub Actions workflow:

### Package managers
```yaml
- name: Install Lets
uses: lets-cli/lets-action@v1.1
with:
version: latest
```

## Update

<Tabs
defaultValue="snap"
values={[
{ label: 'Snap', value: 'snap', },
{ label: 'Homebrew', value: 'homebrew', },
{ label: 'Arch', value: 'arch', },
]}
>
<TabItem value="arch">
### Self Upgrade

You can get binary release from https://aur.archlinux.org/packages/lets-bin/
Starting from version `0.0.30`, lets has a built-in self-upgrade command.

If you are using `yay` as AUR helper:
It updates the binary located at `which lets`.

```bash
yay -S lets-bin
lets self upgrade
```

Also you can get bleeding edge version from https://aur.archlinux.org/packages/lets-git/
Self upgrade is intended for installer-managed and manual user-owned installs. If `lets` was installed by Homebrew,
Arch, or another package manager, use that package manager instead.

If your `lets` version is below `0.0.30`, use the shell script and specify the latest version.

### Homebrew

```bash
yay -S lets-git
brew upgrade lets-cli/tap/lets
```

### Arch

AUR packages provide the latest version.

```bash
yay -Syu lets-bin
```

</TabItem>
<TabItem value="snap">
For the bleeding edge package:

```bash
yay -Syu lets-git
```

TODO
### Shell Script

</TabItem>
<TabItem value="homebrew">
Run the install script again to update `lets` to the latest version.

```bash
brew tap lets-cli/tap
curl -fsSL https://lets-cli.org/install.sh | bash
```

To update to a specific version:

```bash
brew install lets-cli/tap/lets
curl -fsSL https://lets-cli.org/install.sh | LETS_VERSION=v0.0.21 bash
```

</TabItem>
</Tabs>
### Binary

## Update
Download the latest version from [Lets Releases](https://github.com/lets-cli/lets/releases) and replace your existing
`lets` binary.

<Tabs
defaultValue="self"
values={[
{ label: 'Self upgrade', value: 'self', },
{ label: 'Shell script', value: 'shell', },
{ label: 'Binary', value: 'binary', },
{ label: 'Arch', value: 'arch', },
]}
>
<TabItem value="self">
## Uninstall Lets

Starting from version `0.0.30` lets has a built-in self-upgrade command.
### Self Upgrade

It updates binary located at `which lets`
Self upgrade is not a separate install source. If your current binary came from Homebrew or Arch, use the package
manager uninstall instructions below. Otherwise, use the Shell Script or Binary instructions.

### Homebrew

```bash
lets self upgrade
brew uninstall lets-cli/tap/lets
```

If your `lets` version is below `0.0.30` - use shell script and specify the latest version.
Optionally remove the tap after uninstalling:

</TabItem>
<TabItem value="shell">
```bash
brew untap lets-cli/tap
```

To update `lets` you can use shell script
### Arch

```bash
yay -R lets-bin
```
curl --proto '=https' --tlsv1.2 -sSf https://lets-cli.org/install.sh | sh -s -- -b $(dirname $(which lets))

For the bleeding edge package:

```bash
yay -R lets-git
```

Running script will update `lets` to **latest** version.
### Shell Script

</TabItem>
<TabItem value="binary">
Remove the install script binary and common PATH symlinks:

You can download latest version from [Lets Releases](https://github.com/lets-cli/lets/releases).
```bash
rm -f "$HOME/.local/bin/lets" "$HOME/bin/lets" "$HOME/.bin/lets"
rm -rf "$HOME/.lets"
```

</TabItem>
<TabItem value="arch">
If you installed with a custom `LETS_HOME`, remove that directory instead of `$HOME/.lets`.

AUR repository always provides **latest** version.
If the installer added `$HOME/.local/bin` to your shell profile, remove the `# lets` block from that profile.

</TabItem>
</Tabs>
### Binary

Remove the binary from the location where you installed it.

For example, if it is the active `lets` on your `PATH` and is not managed by Homebrew or Arch:

```bash
rm -f "$(command -v lets)"
```
Loading
Loading