This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
manjaroConfiguration/installTLDR.sh
2022-01-20 11:49:40 +01:00

19 lines
769 B
Bash

# Install Rust if not already installed
which rustc &> /dev/null || wget -q --show-progress https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/installRust.sh -O - | ( bash; source $HOME/.cargo/env )
# Install tldr
cargo install tealdeer
# Update database
tldr --update
# Add completion for fish
# Download the file from the latest release...
latest=$(wget -qO- https://api.github.com/repos/dbrgn/tealdeer/releases/latest)
url=$(grep 'browser_download_url": ".*/completions_fish"' <<< "$latest" | awk '{ print substr ($0, 32 ) }' | awk '{ print substr( $0, 1, length($0)-1 ) }')
wget -q --show-progress $url -O completions_fish
# Move it to his correct location
mv completions_fish ~/.config/fish/completions/tldr.fish
echo -e "\ntldr installed! 🎉"