Terminal Markdown previewer — GUI-like experience.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: release installers

RivoLink 8f75fced 0e80c36d

+187 -2
+30 -2
README.md
··· 6 6 Terminal Markdown previewer — GUI-like experience. 7 7 </p> 8 8 9 - ## Build & install 9 + ## Install 10 10 11 - Build the release binary: 11 + Install the latest published binary: 12 + 13 + ```bash 14 + curl -fsSL https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.sh | sh 15 + ``` 16 + 17 + Or download then run: 18 + 19 + ```bash 20 + curl -fsSL -o install.sh https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.sh 21 + sh install.sh ~/.local/bin 22 + ``` 23 + 24 + On Windows: 25 + 26 + ```powershell 27 + irm https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.ps1 | iex 28 + ``` 29 + 30 + Or download then run: 31 + 32 + ```powershell 33 + Invoke-WebRequest https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.ps1 -OutFile install.ps1 34 + powershell -ExecutionPolicy Bypass -File .\install.ps1 -Destination $HOME\bin 35 + ``` 36 + 37 + ## Build 38 + 39 + Build the release binary locally: 12 40 13 41 ```bash 14 42 cargo build --release
+25
scripts/install.ps1
··· 1 + param( 2 + [string]$Destination = "$HOME\bin" 3 + ) 4 + 5 + $ErrorActionPreference = "Stop" 6 + 7 + $repo = "RivoLink/leaf" 8 + $destinationDir = $Destination 9 + $destinationBin = Join-Path $destinationDir "leaf.exe" 10 + $assetName = "leaf-windows-x86_64.exe" 11 + 12 + New-Item -ItemType Directory -Force -Path $destinationDir | Out-Null 13 + 14 + $release = Invoke-RestMethod "https://api.github.com/repos/$repo/releases/latest" 15 + if (-not $release.tag_name) { 16 + throw "Unable to resolve latest release tag for $repo" 17 + } 18 + 19 + $tagName = $release.tag_name 20 + $downloadUrl = "https://github.com/$repo/releases/download/$tagName/$assetName" 21 + 22 + Invoke-WebRequest -Uri $downloadUrl -OutFile $destinationBin 23 + 24 + Write-Host "Installed leaf $tagName to $destinationBin" 25 + Write-Host "Add $destinationDir to PATH if needed."
+132
scripts/install.sh
··· 1 + #!/usr/bin/env sh 2 + set -eu 3 + 4 + REPO="RivoLink/leaf" 5 + DEST_DIR="${1:-$HOME/.local/bin}" 6 + DEST_BIN="$DEST_DIR/leaf" 7 + 8 + need_cmd() { 9 + if ! command -v "$1" >/dev/null 2>&1; then 10 + echo "Missing required command: $1" >&2 11 + exit 1 12 + fi 13 + } 14 + 15 + latest_tag() { 16 + if command -v curl >/dev/null 2>&1; then 17 + curl -fsSIL "https://github.com/$REPO/releases/latest" | 18 + sed -n 's/^[Ll]ocation: .*\/releases\/tag\/\([^[:space:]\r]*\).*/\1/p' | 19 + tail -n 1 20 + elif command -v wget >/dev/null 2>&1; then 21 + wget -S --max-redirect=0 -O /dev/null "https://github.com/$REPO/releases/latest" 2>&1 | 22 + sed -n 's/^ Location: .*\/releases\/tag\/\([^[:space:]\r]*\).*/\1/p' | 23 + tail -n 1 24 + else 25 + echo "Missing required command: curl or wget" >&2 26 + exit 1 27 + fi 28 + } 29 + 30 + download_to() { 31 + url="$1" 32 + output="$2" 33 + 34 + if command -v curl >/dev/null 2>&1; then 35 + curl -fsSL "$url" -o "$output" 36 + elif command -v wget >/dev/null 2>&1; then 37 + wget -qO "$output" "$url" 38 + else 39 + echo "Missing required command: curl or wget" >&2 40 + exit 1 41 + fi 42 + } 43 + 44 + detect_asset() { 45 + os_name="$(uname -s)" 46 + arch_name="$(uname -m)" 47 + os_extra="$(uname -o 2>/dev/null || true)" 48 + 49 + case "$os_name:$arch_name:$os_extra" in 50 + Linux:aarch64:Android | Linux:arm64:Android) 51 + echo "leaf-android-arm64" 52 + return 0 53 + ;; 54 + esac 55 + 56 + if [ "${TERMUX_VERSION:-}" != "" ]; then 57 + case "$arch_name" in 58 + aarch64 | arm64) 59 + echo "leaf-android-arm64" 60 + return 0 61 + ;; 62 + esac 63 + fi 64 + 65 + case "$os_name" in 66 + Darwin) 67 + case "$arch_name" in 68 + x86_64 | amd64) 69 + echo "leaf-macos-x86_64" 70 + ;; 71 + arm64 | aarch64) 72 + echo "leaf-macos-arm64" 73 + ;; 74 + *) 75 + echo "Unsupported macOS architecture: $arch_name" >&2 76 + exit 1 77 + ;; 78 + esac 79 + ;; 80 + Linux) 81 + case "$arch_name" in 82 + x86_64 | amd64) 83 + echo "leaf-linux-x86_64" 84 + ;; 85 + aarch64 | arm64) 86 + echo "leaf-linux-arm64" 87 + ;; 88 + *) 89 + echo "Unsupported Linux architecture: $arch_name" >&2 90 + exit 1 91 + ;; 92 + esac 93 + ;; 94 + *) 95 + echo "Unsupported platform: $os_name $arch_name" >&2 96 + exit 1 97 + ;; 98 + esac 99 + } 100 + 101 + need_cmd sed 102 + need_cmd uname 103 + need_cmd mktemp 104 + need_cmd chmod 105 + need_cmd mkdir 106 + need_cmd cp 107 + 108 + asset_name="$(detect_asset)" 109 + tag_name="$(latest_tag)" 110 + 111 + if [ -z "$tag_name" ]; then 112 + echo "Unable to resolve latest release tag for $REPO" >&2 113 + exit 1 114 + fi 115 + 116 + download_url="https://github.com/$REPO/releases/download/$tag_name/$asset_name" 117 + tmp_file="$(mktemp)" 118 + trap 'rm -f "$tmp_file"' EXIT 119 + 120 + mkdir -p "$DEST_DIR" 121 + download_to "$download_url" "$tmp_file" 122 + cp "$tmp_file" "$DEST_BIN" 123 + chmod 755 "$DEST_BIN" 124 + 125 + echo "Installed leaf $tag_name to $DEST_BIN" 126 + case ":$PATH:" in 127 + *:"$DEST_DIR":*) 128 + ;; 129 + *) 130 + echo "Add $DEST_DIR to PATH if needed." 131 + ;; 132 + esac