summaryrefslogtreecommitdiffhomepage
path: root/bin/install-pkg
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-04 21:21:20 +0900
committerAdam Malczewski <[email protected]>2026-06-04 21:21:20 +0900
commit394f1ed37ce860da6fdc385769bf29f9737105cd (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /bin/install-pkg
parent81a9cdbadf8c9d940d4fe9a2a0de607dee1f5f1a (diff)
downloaddispatch-394f1ed37ce860da6fdc385769bf29f9737105cd.tar.gz
dispatch-394f1ed37ce860da6fdc385769bf29f9737105cd.zip
chore: genesis — remove all files to rebuild from scratch (arch rewrite)
Diffstat (limited to 'bin/install-pkg')
-rwxr-xr-xbin/install-pkg76
1 files changed, 0 insertions, 76 deletions
diff --git a/bin/install-pkg b/bin/install-pkg
deleted file mode 100755
index 9af784d..0000000
--- a/bin/install-pkg
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env bash
-# Install one or more built dispatch packages with yay -U.
-#
-# Default: installs the freshest dispatch + dispatch-systemd from packaging/.
-# Pass package names (without version) to install a custom set.
-#
-# Usage:
-# bin/install-pkg # dispatch + dispatch-systemd + code-search
-# bin/install-pkg dispatch dispatch-s6 # dispatch + dispatch-s6
-# bin/install-pkg dispatch dispatch-electron # dispatch + electron wrapper
-# bin/install-pkg --all # every freshest pkg found
-
-set -euo pipefail
-
-SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
-PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
-PACKAGING_DIR="$PROJECT_DIR/packaging"
-ELECTRON_DIR="$PROJECT_DIR/packaging/electron"
-
-# Find the most recent .pkg.tar.zst matching a package name in a given dir.
-find_pkg() {
- local name="$1" dir="$2"
- ls -t "$dir"/"$name"-[0-9]*-x86_64.pkg.tar.zst 2>/dev/null | head -1
-}
-
-# Resolve a package name to its freshest tarball, searching both dirs.
-resolve_pkg() {
- local name="$1" path
- path=$(find_pkg "$name" "$PACKAGING_DIR")
- [ -n "$path" ] || path=$(find_pkg "$name" "$ELECTRON_DIR")
- echo "$path"
-}
-
-declare -a names
-declare -a paths
-
-if [ $# -eq 0 ]; then
- names=(dispatch dispatch-systemd)
- # code-search ships a self-contained `cs` binary pinned to _cs_commit in the
- # PKGBUILD; it rarely changes. Skip reinstalling it if it's already present —
- # run `bin/install-pkg code-search` to force a reinstall (e.g. after a bump).
- if pacman -Qq code-search &>/dev/null; then
- echo "code-search already installed — skipping (run 'bin/install-pkg code-search' to force)"
- else
- names+=(code-search)
- fi
-elif [ "${1:-}" = "--all" ]; then
- names=(dispatch dispatch-systemd dispatch-s6 dispatch-electron code-search)
-else
- names=("$@")
-fi
-
-for name in "${names[@]}"; do
- path=$(resolve_pkg "$name")
- if [ -z "$path" ]; then
- # --all is lenient: skip missing packages
- if [ "${1:-}" = "--all" ]; then
- echo "warn: no built package found for '$name', skipping" >&2
- continue
- fi
- echo "error: no built package found for '$name'" >&2
- echo " run bin/build-pkg (or bin/build-pkg-electron) first." >&2
- exit 1
- fi
- paths+=("$path")
-done
-
-if [ ${#paths[@]} -eq 0 ]; then
- echo "error: nothing to install." >&2
- exit 1
-fi
-
-echo "Installing:"
-printf ' %s\n' "${paths[@]}"
-echo ""
-yay -U "${paths[@]}"