Skip to content

Instantly share code, notes, and snippets.

@lmlsna
Last active January 28, 2025 05:18

Revisions

  1. lmlsna revised this gist Jan 28, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-mdcat
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ cd "$tmpdir"
    #git clone https://codeberg.org/flausch/mdcat
    git clone https://github.com/swsnr/mdcat
    cd mdcat
    cargo build --release
    cargo build --release || cargo build --release -Znext-lockfile-bump
    sudo mv -v target/release/mdcat /usr/local/bin/
    cd /tmp
    sudo rm -r "$tmpdir"
  2. lmlsna revised this gist Jan 28, 2025. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions install-mdcat
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/bash

    #sudo apt install -y git rust-all # need rust v1.83 or better
    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
    @@ -9,7 +9,6 @@ if [[ "$(which rustc)" == "" ]]; then
    echo "Unknown problem installed rust (dependency). Exiting."
    exit 1
    fi

    fi

    tmpdir=$(mktemp -d --suffix=.git)
  3. lmlsna revised this gist Jan 28, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-mdcat
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ cd "$tmpdir"
    #git clone https://codeberg.org/flausch/mdcat
    git clone https://github.com/swsnr/mdcat
    cd mdcat
    cargo build --release -Znext-lockfile-bump
    cargo build --release
    sudo mv -v target/release/mdcat /usr/local/bin/
    cd /tmp
    sudo rm -r "$tmpdir"
  4. lmlsna revised this gist Jan 28, 2025. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion install-mdcat
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,13 @@
    #sudo apt install -y git rust-all # 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)
    @@ -13,4 +20,4 @@ cd mdcat
    cargo build --release -Znext-lockfile-bump
    sudo mv -v target/release/mdcat /usr/local/bin/
    cd /tmp
    rm -r "$tmpdir"
    sudo rm -r "$tmpdir"
  5. lmlsna revised this gist Jan 28, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-mdcat
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    #sudo apt install -y git rust-all # need rust v1.83 or better
    if [[ "$(which rustc)" == "" ]]; then
    source "$(dirname $0)/install-rust"
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    fi

    tmpdir=$(mktemp -d --suffix=.git)
  6. lmlsna created this gist Jan 28, 2025.
    16 changes: 16 additions & 0 deletions install-mdcat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/bash

    #sudo apt install -y git rust-all # need rust v1.83 or better
    if [[ "$(which rustc)" == "" ]]; then
    source "$(dirname $0)/install-rust"
    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 -Znext-lockfile-bump
    sudo mv -v target/release/mdcat /usr/local/bin/
    cd /tmp
    rm -r "$tmpdir"