Files
Move/dev-setup.sh
T
nokeo08 b43d5aad2d Add curl-pipe installer, uninstaller, and contributor bootstrap
End-user installation collapses to a single command:

  curl -fsSL https://gitea.cahlen.com/nokeo08/Move/raw/branch/master/install.sh | sh

Changes:

- install.sh rewritten as a POSIX sh, curl-pipeable end-user installer.
  Honors XDG_DATA_HOME and XDG_BIN_HOME (de facto). Idempotent via a
  version-marker file at $INSTALL_DIR/.installed-version; MOVE_FORCE=1
  overrides. Hard-fails if Bun is missing (no auto-install). Includes
  a safety guard refusing rm -rf on too-broad install dirs.
- uninstall.sh added; same curl-pipe pattern, shared XDG path
  resolution, leaves Bun alone.
- dev-setup.sh added (= the previous install.sh content, retitled for
  contributors and pointing at bun run start / bun link / install.sh).
- README updated: curl one-liner Install section, XDG behavior tables,
  new Uninstall section, new 'For contributors' section, Files table
  rows for all three scripts.
2026-06-17 11:55:03 -05:00

48 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# dev-setup.sh - contributor bootstrap for the `move` repo.
#
# Use this when you have cloned the repo and want a working development
# environment. End users should use `install.sh` (curl-pipeable) instead.
#
# Verifies Bun is installed, then runs `bun install` to fetch dependencies
# (notably `@nut-tree-fork/nut-js`, which ships prebuilt native binaries
# for darwin-arm64/x64, linux, and windows).
#
# This script is idempotent: re-running it just re-resolves the dependency
# tree against the existing `bun.lock`.
# Fail fast on any error, unset variable, or failed pipe stage.
set -euo pipefail
# Always operate relative to the script's own directory so the install works
# regardless of the caller's CWD.
cd "$(dirname "$0")"
echo "==> Checking for Bun..."
if ! command -v bun >/dev/null 2>&1; then
# Hard error rather than auto-install: keep the script's behavior
# predictable and let the user pick their own install method.
echo "Error: bun is not installed." >&2
echo " Install it from https://bun.sh (e.g. 'brew install oven-sh/bun/bun') and re-run." >&2
exit 1
fi
echo " bun $(bun --version)"
echo "==> Installing dependencies..."
bun install
echo
echo "Done. Dev workflow:"
echo " - 'bun run start' to run from the source tree."
echo " - 'bun link' to install a global 'move' command pointed at this checkout."
echo "End-user installer is install.sh (curl-pipeable from Gitea)."
# macOS gates synthetic mouse events behind the Accessibility permission.
# Without this hint, the first run silently fails to move the cursor and
# the user has no obvious next step.
if [[ "$(uname)" == "Darwin" ]]; then
echo "Note: macOS will prompt for Accessibility permission on first mouse move."
echo " Grant it under System Settings > Privacy & Security > Accessibility."
fi