Skip to content

Instantly share code, notes, and snippets.

@lmlsna
Last active January 28, 2025 05:18
Show Gist options
  • Save lmlsna/c8dab1759744b02356e74fced8bda5f2 to your computer and use it in GitHub Desktop.
Save lmlsna/c8dab1759744b02356e74fced8bda5f2 to your computer and use it in GitHub Desktop.
Install `mdcat` from latest source
#!/bin/bash
sudo apt install -y git curl openssl libssl-dev pkg-config # need rust v1.83 or better
if [[ "$(which rustc)" == "" ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env" # For sh/bash/zsh/ash/dash/pdksh
rustc --version
if [[ $? -ne 0 ]]; then
echo "Unknown problem installed rust (dependency). Exiting."
exit 1
fi
fi
tmpdir=$(mktemp -d --suffix=.git)
cd "$tmpdir"
#git clone https://codeberg.org/flausch/mdcat
git clone https://github.com/swsnr/mdcat
cd mdcat
cargo build --release || cargo build --release -Znext-lockfile-bump
sudo mv -v target/release/mdcat /usr/local/bin/
cd /tmp
sudo rm -r "$tmpdir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment