tmux-thumbs/tmux-thumbs-install.sh
Ferran Basora a32499fadf Improve the installation process
Many people are struggling with the installation process because is not
giving enough feedback.

This commit improves this.
2021-12-27 12:42:49 +01:00

56 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -Eeu -o pipefail
# Removing the binary to make this script idempotent
rm -rf target/release/thumbs
clear
cat << EOF
█████ █████ █████ █████
░░███ ░░███ ░░███ ░░███
███████ █████████████ █████ ████ █████ █████ ███████ ░███████ █████ ████ █████████████ ░███████ █████
░░░███░ ░░███░░███░░███ ░░███ ░███ ░░███ ░░███ ██████████░░░███░ ░███░░███ ░░███ ░███ ░░███░░███░░███ ░███░░███ ███░░
░███ ░███ ░███ ░███ ░███ ░███ ░░░█████░ ░░░░░░░░░░ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███░░█████
░███ ███ ░███ ░███ ░███ ░███ ░███ ███░░░███ ░███ ███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░░░░███
░░█████ █████░███ █████ ░░████████ █████ █████ ░░█████ ████ █████ ░░████████ █████░███ █████ ████████ ██████
░░░░░ ░░░░░ ░░░ ░░░░░ ░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░ ░░░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░ ░░░░░░░░ ░░░░░░
It looks like this is the first time you are executing tmux-thumbs
because the binary is not present.
We are going to proceed with the installation. Remember that Rust is
a prerequisite to being able to build tmux-thumbs.
Do you want to continue?
Press any key to continue...
EOF
read -s -n 1
if ! [ -x "$(command -v cargo)" ]; then
echo 'Rust is not installed! ❌' >&2
echo 'Press any key to install it' >&2
read -s -n 1
# This installation es provided by the official https://rustup.rs documentation
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
echo 'Compiling tmux-thumbs, be patient:'
cargo build --release --target-dir=target
cat << EOF
Installation complete! 💯
Press any key to close this pane...
EOF
read -s -n 1