detached 1384496

feat: add install script for linux/x86_64 and darwin/arm64

commit
13844963694aec180c29e6af73190f285249c390
author
brice · · 2026-07-17 06:58 UTC
parent
c5f4fce
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +81 -0
A install.sh +81 -0
@@ -0,0 +1,81 @@
1+#!/bin/sh
2+# vev installer — Linux x86_64 and macOS arm64.
3+# Usage: curl -fsSL https://raw.githubusercontent.com/bnema/vev/main/install.sh | sh
4+# Env: VEV_VERSION=vX.Y.Z to pin a version (default: latest release).
5+set -eu
6+
7+REPO="bnema/vev"
8+VERSION="${VEV_VERSION:-latest}"
9+
10+info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
11+err() { printf '\033[1;31merror:\033[0m %s\n' "$*" >&2; exit 1; }
12+
13+# --- Detect platform -------------------------------------------------------
14+OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
15+ARCH="$(uname -m)"
16+case "$OS/$ARCH" in
17+ linux/x86_64|linux/amd64) TARBALL="vev_linux_x86_64.tar.gz" ;;
18+ darwin/arm64) TARBALL="vev_darwin_arm64.tar.gz" ;;
19+ *) err "unsupported platform: $OS/$ARCH (supported: linux/x86_64, darwin/arm64)" ;;
20+esac
21+
22+# --- Pick install dir ------------------------------------------------------
23+if [ -d "$HOME/.local/bin" ]; then
24+ INSTALL_DIR="$HOME/.local/bin"
25+else
26+ INSTALL_DIR="/usr/local/bin"
27+fi
28+
29+# --- Resolve version -------------------------------------------------------
30+if [ "$VERSION" = "latest" ]; then
31+ VERSION="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
32+ | grep '"tag_name"' | head -1 | cut -d '"' -f 4)"
33+ [ -n "$VERSION" ] || err "could not resolve the latest release tag"
34+fi
35+info "installing vev ${VERSION} (${OS}/${ARCH}) to ${INSTALL_DIR}"
36+
37+# --- Download + verify -----------------------------------------------------
38+TMP_DIR="$(mktemp -d)"
39+trap 'rm -rf "$TMP_DIR"' EXIT
40+
41+BASE_URL="https://github.com/${REPO}/releases/download/${VERSION}"
42+curl -fsSL -o "$TMP_DIR/$TARBALL" "$BASE_URL/$TARBALL" \
43+ || err "download failed: $BASE_URL/$TARBALL"
44+curl -fsSL -o "$TMP_DIR/checksums.txt" "$BASE_URL/checksums.txt" \
45+ || err "download failed: $BASE_URL/checksums.txt"
46+
47+cd "$TMP_DIR"
48+EXPECTED="$(grep " $TARBALL\$" checksums.txt | cut -d ' ' -f 1)"
49+[ -n "$EXPECTED" ] || err "$TARBALL not found in checksums.txt"
50+if command -v sha256sum >/dev/null 2>&1; then
51+ ACTUAL="$(sha256sum "$TARBALL" | cut -d ' ' -f 1)"
52+else
53+ ACTUAL="$(shasum -a 256 "$TARBALL" | cut -d ' ' -f 1)"
54+fi
55+[ "$EXPECTED" = "$ACTUAL" ] || err "checksum mismatch for $TARBALL (expected $EXPECTED, got $ACTUAL)"
56+info "checksum verified"
57+
58+# --- Extract + install -----------------------------------------------------
59+tar -xzf "$TARBALL"
60+
61+do_install() {
62+ # $1 = src, $2 = dst dir
63+ if [ -w "$2" ]; then
64+ install -m 755 "$1" "$2/"
65+ else
66+ info "escalating with sudo to write into $2"
67+ sudo install -m 755 "$1" "$2/"
68+ fi
69+}
70+
71+mkdir -p "$INSTALL_DIR" 2>/dev/null || true
72+do_install vev "$INSTALL_DIR"
73+# Default status-bar segments; vev's default config references them by name.
74+do_install scripts/vev-bar-top-right "$INSTALL_DIR"
75+do_install scripts/vev-bar-bottom-right "$INSTALL_DIR"
76+
77+info "installed: $INSTALL_DIR/vev"
78+case ":$PATH:" in
79+ *":$INSTALL_DIR:"*) "$INSTALL_DIR/vev" --version ;;
80+ *) info "note: $INSTALL_DIR is not in your PATH" ;;
81+esac
@@ -0,0 +1,81 @@
1+#!/bin/sh
2+# vev installer — Linux x86_64 and macOS arm64.
3+# Usage: curl -fsSL https://raw.githubusercontent.com/bnema/vev/main/install.sh | sh
4+# Env: VEV_VERSION=vX.Y.Z to pin a version (default: latest release).
5+set -eu
6+
7+REPO="bnema/vev"
8+VERSION="${VEV_VERSION:-latest}"
9+
10+info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
11+err() { printf '\033[1;31merror:\033[0m %s\n' "$*" >&2; exit 1; }
12+
13+# --- Detect platform -------------------------------------------------------
14+OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
15+ARCH="$(uname -m)"
16+case "$OS/$ARCH" in
17+ linux/x86_64|linux/amd64) TARBALL="vev_linux_x86_64.tar.gz" ;;
18+ darwin/arm64) TARBALL="vev_darwin_arm64.tar.gz" ;;
19+ *) err "unsupported platform: $OS/$ARCH (supported: linux/x86_64, darwin/arm64)" ;;
20+esac
21+
22+# --- Pick install dir ------------------------------------------------------
23+if [ -d "$HOME/.local/bin" ]; then
24+ INSTALL_DIR="$HOME/.local/bin"
25+else
26+ INSTALL_DIR="/usr/local/bin"
27+fi
28+
29+# --- Resolve version -------------------------------------------------------
30+if [ "$VERSION" = "latest" ]; then
31+ VERSION="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
32+ | grep '"tag_name"' | head -1 | cut -d '"' -f 4)"
33+ [ -n "$VERSION" ] || err "could not resolve the latest release tag"
34+fi
35+info "installing vev ${VERSION} (${OS}/${ARCH}) to ${INSTALL_DIR}"
36+
37+# --- Download + verify -----------------------------------------------------
38+TMP_DIR="$(mktemp -d)"
39+trap 'rm -rf "$TMP_DIR"' EXIT
40+
41+BASE_URL="https://github.com/${REPO}/releases/download/${VERSION}"
42+curl -fsSL -o "$TMP_DIR/$TARBALL" "$BASE_URL/$TARBALL" \
43+ || err "download failed: $BASE_URL/$TARBALL"
44+curl -fsSL -o "$TMP_DIR/checksums.txt" "$BASE_URL/checksums.txt" \
45+ || err "download failed: $BASE_URL/checksums.txt"
46+
47+cd "$TMP_DIR"
48+EXPECTED="$(grep " $TARBALL\$" checksums.txt | cut -d ' ' -f 1)"
49+[ -n "$EXPECTED" ] || err "$TARBALL not found in checksums.txt"
50+if command -v sha256sum >/dev/null 2>&1; then
51+ ACTUAL="$(sha256sum "$TARBALL" | cut -d ' ' -f 1)"
52+else
53+ ACTUAL="$(shasum -a 256 "$TARBALL" | cut -d ' ' -f 1)"
54+fi
55+[ "$EXPECTED" = "$ACTUAL" ] || err "checksum mismatch for $TARBALL (expected $EXPECTED, got $ACTUAL)"
56+info "checksum verified"
57+
58+# --- Extract + install -----------------------------------------------------
59+tar -xzf "$TARBALL"
60+
61+do_install() {
62+ # $1 = src, $2 = dst dir
63+ if [ -w "$2" ]; then
64+ install -m 755 "$1" "$2/"
65+ else
66+ info "escalating with sudo to write into $2"
67+ sudo install -m 755 "$1" "$2/"
68+ fi
69+}
70+
71+mkdir -p "$INSTALL_DIR" 2>/dev/null || true
72+do_install vev "$INSTALL_DIR"
73+# Default status-bar segments; vev's default config references them by name.
74+do_install scripts/vev-bar-top-right "$INSTALL_DIR"
75+do_install scripts/vev-bar-bottom-right "$INSTALL_DIR"
76+
77+info "installed: $INSTALL_DIR/vev"
78+case ":$PATH:" in
79+ *":$INSTALL_DIR:"*) "$INSTALL_DIR/vev" --version ;;
80+ *) info "note: $INSTALL_DIR is not in your PATH" ;;
81+esac

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close