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
59 changes: 59 additions & 0 deletions simplexup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# simplexup

Install, update, and manage Simplex with ease.

## Installing

Download simplexup:

```bash
curl -L https://raw.githubusercontent.com/BlockstreamResearch/smplx/master/simplexup/install | bash
```

## Usage

To install the latest stable Simplex version:

```bash
simplexup
```

To install a specific version (in this case the `v0.1.0` version):

```bash
simplexup --install 0.1.0
```

To list all versions installed:

```bash
simplexup --list
```

To switch between different versions:

```bash
simplexup --use 0.1.0
```

To update `simplexup`:

```bash
simplexup --update
```

## Uninstalling

Simplex contains everything in a `.simplex` directory located in `/home/<user>/.simplex/` on Linux and `/Users/<user>/.simplex/` on Macos, where `<user>` is your username.

To uninstall Simplex, just remove the `.simplex` directory.

Optionally remove Simplex from PATH:

```bash
export PATH="$PATH:/home/user/.simplex/bin"
```

## Disclaimer

GLHF!
42 changes: 42 additions & 0 deletions simplexup/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -eo pipefail

echo "Installing simplexup..."

BASE_DIR="${XDG_CONFIG_HOME:-$HOME}"
SIMPLEX_DIR="${SIMPLEX_DIR:-"$BASE_DIR/.simplex"}"
SIMPLEX_BIN_DIR="$SIMPLEX_DIR/bin"

BIN_URL="https://raw.githubusercontent.com/BlockstreamResearch/smplx/master/simplexup/install"
BIN_PATH="$SIMPLEX_BIN_DIR/simplexup"

# Create the .simplex bin directory and simplexup binary if it doesn't exist.
mkdir -p "$SIMPLEX_BIN_DIR"
curl -sSf -L "$BIN_URL" -o "$BIN_PATH"
chmod +x "$BIN_PATH"

# Store the correct profile file (i.e. .profile for bash or .zshenv for ZSH).
case $SHELL in
*/zsh)
PROFILE="${ZDOTDIR-"$HOME"}/.zshenv"
PREF_SHELL=zsh
;;
*/bash)
PROFILE=$HOME/.bashrc
PREF_SHELL=bash
;;
*)
echo "simplexup: could not detect shell, manually add ${SIMPLEX_BIN_DIR} to your PATH."
exit 1
esac

# Only add simplexup if it isn't already in PATH.
if [[ ":$PATH:" != *":${SIMPLEX_BIN_DIR}:"* ]]; then
# Add the simplexup directory to the path and ensure the old PATH variables remain.
echo >> "$PROFILE" && echo "export PATH=\"\$PATH:$SIMPLEX_BIN_DIR\"" >> "$PROFILE"
fi

echo
echo "Detected your preferred shell is $PREF_SHELL and added simplexup to PATH."
echo "Run 'source $PROFILE' or start a new terminal session to use simplexup."
echo "Then, simply run 'simplexup' to install Simplex."
Loading