feat: install script for users and readme
2 files changed, +45 -0
+20-0README.md
| @@ -4,6 +4,26 @@ A native desktop JSON viewer with intelligent schema inference, cross-file compa | ||
| 4 | 4 | |
| 5 | 5 | Built with Rust and [egui](https://github.com/emilk/egui) for native performance — no Electron, no web runtime. Themed with Catppuccin Mocha. |
| 6 | 6 | |
| 7 | +## Install | |
| 8 | + | |
| 9 | +jv releases prebuilt binaries in github. | |
| 10 | + | |
| 11 | +### One Liner Install | |
| 12 | + | |
| 13 | +Uses curl to download prebuilt binary into `~/.local/jv` and symlinks | |
| 14 | +`~/.local/bin/jv` to `~/.local/jv/bin/jv`. This can also be used for updating | |
| 15 | +to latest version. | |
| 16 | + | |
| 17 | +```bash | |
| 18 | +curl https://raw.githubusercontent.com/huncholane/jv/refs/heads/main/install | sh | |
| 19 | +``` | |
| 20 | + | |
| 21 | +Remember to add `~/.local/bin` to the path. | |
| 22 | + | |
| 23 | +```bash | |
| 24 | +export PATH="$PATH:$HOME/.local/bin" | |
| 25 | +``` | |
| 26 | + | |
| 7 | 27 | ## Features |
| 8 | 28 | |
| 9 | 29 | ### Four Modes |
+25-0install
| @@ -0,0 +1,25 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# Author: Lane Henslee | |
| 3 | +# Downloads jv using github release based on detected system into ~/.local/jv | |
| 4 | +# Creates a symlink from ~/.local/bin/jv pointing to ~/.local/jv/bin/jv | |
| 5 | +# User needs to add ~/.local/bin to PATH | |
| 6 | + | |
| 7 | +# Setup up for fresh install | |
| 8 | +mkdir -p ~/.local | |
| 9 | +rm -rf ~/.local/jv | |
| 10 | +rm -f ~/.local/bin/jv | |
| 11 | + | |
| 12 | +# Determine architecture | |
| 13 | +case "$(uname -s)$(uname -m)" in | |
| 14 | +"Linuxx86_64") arch="linux-x86_64" ;; | |
| 15 | +"Linuxaarch64") arch="linux-aarch64" ;; | |
| 16 | +"Darwinx86_64") arch="macos-x86_64" ;; | |
| 17 | +"Darwinarm64") arch="macos-aarch64" ;; | |
| 18 | +*) echo -e "\033[31mUnsupported architecture. Try building from source." && exit 1 ;; | |
| 19 | +esac | |
| 20 | +url="https://github.com/huncholane/jv/releases/latest/download/jv-$arch.tar.gz" | |
| 21 | +echo "Downloading from $url" | |
| 22 | + | |
| 23 | +# Download latest version | |
| 24 | +curl -fsSL "$url" | tar xzvf - -C ~/.local/ | |
| 25 | +ln -s ~/.local/jv/bin/jv ~/.local/bin/jv |