From ca65bdcfb9896a88d620201dae382c5d88dcb747 Mon Sep 17 00:00:00 2001 From: Juan Barbat Date: Tue, 7 Jul 2026 08:34:14 -0300 Subject: [PATCH 1/2] feat: support installing from release via one-liner installer --- CHANGELOG.md | 2 ++ README.md | 14 ++++++++++++++ install.sh | 26 +++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97012a0..811a980 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ > Breaking: this release removes all code and documentation that belongs to the cortex product. This repo is now exclusively dotfiles — configuration files, installer, and shell aliases. +- `curl -fsSL https://raw.githubusercontent.com/barbatdev/cortex-dots/v0.2.0/install.sh | bash` installs from this release. + ### Breaking - Removed `docs/` — agent-state spec, workflow docs, keymaps, release checklist (belong to cortex product). diff --git a/README.md b/README.md index 79a749c..7ca5bb2 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,20 @@ The repo is intentionally generic. Private paths, tokens, emails, hostnames, pro ## Install +Install latest release: + +```bash +curl -fsSL https://raw.githubusercontent.com/barbatdev/cortex-dots/v0.2.0/install.sh | bash +``` + +Install a specific version: + +```bash +curl -fsSL https://raw.githubusercontent.com/barbatdev/cortex-dots/v0.1.1/install.sh | bash +``` + +Install from source (manual): + ```bash git clone ~/.cortex/cortex-dots cd ~/.cortex/cortex-dots diff --git a/install.sh b/install.sh index 046ec35..676f722 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,31 @@ # install.sh — Instalador de dotfiles set -e -DOTFILES="$(cd "$(dirname "$0")" && pwd)" +# If running via curl pipe (stdin), download to temp dir from the repo. +# Usage: curl -fsSL https://raw.githubusercontent.com/barbatdev/cortex-dots/v0.2.0/install.sh | bash +if [ -t 0 ]; then + DOTFILES="$(cd "$(dirname "$0")" && pwd)" +else + # Running from stdin — download the repo to a temp dir. + # Allow overriding the release tag via CORTEX_DOTS_TAG env var. + REPO_ORG="barbatdev" + REPO_NAME="cortex-dots" + TAG="${CORTEX_DOTS_TAG:-main}" + TMPDIR_INSTALL="$(mktemp -d)" + trap 'rm -rf "$TMPDIR_INSTALL"' EXIT INT TERM + DOTFILES="$TMPDIR_INSTALL/$REPO_NAME" + curl -fsSL "https://github.com/${REPO_ORG}/${REPO_NAME}/archive/refs/tags/${TAG}.tar.gz" -o "$TMPDIR_INSTALL/release.tar.gz" + tar -xzf "$TMPDIR_INSTALL/release.tar.gz" -C "$TMPDIR_INSTALL" + # The tarball extracts as $REPO_NAME-$TAG/, rename to clean path + EXTRACTED_DIR="$TMPDIR_INSTALL/${REPO_NAME}-${TAG}" + if [ -d "$EXTRACTED_DIR" ]; then + mv "$EXTRACTED_DIR" "$DOTFILES" + fi + if [ ! -f "$DOTFILES/install.sh" ]; then + echo "ERROR: could not download release $TAG from GitHub" >&2 + exit 1 + fi +fi TIMESTAMP=$(date +%Y%m%d_%H%M%S) DRY_RUN=false CHECK_MODE=false From a1cd682025f556d9c0a9ae62762ed88011e550a9 Mon Sep 17 00:00:00 2001 From: Juan Barbat Date: Tue, 7 Jul 2026 15:28:31 -0300 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20reviewer=20nits=20=E2=80=94=20EXIT?= =?UTF-8?q?=20trap=20leak=20+=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 676f722..d953024 100755 --- a/install.sh +++ b/install.sh @@ -15,15 +15,21 @@ else TMPDIR_INSTALL="$(mktemp -d)" trap 'rm -rf "$TMPDIR_INSTALL"' EXIT INT TERM DOTFILES="$TMPDIR_INSTALL/$REPO_NAME" - curl -fsSL "https://github.com/${REPO_ORG}/${REPO_NAME}/archive/refs/tags/${TAG}.tar.gz" -o "$TMPDIR_INSTALL/release.tar.gz" - tar -xzf "$TMPDIR_INSTALL/release.tar.gz" -C "$TMPDIR_INSTALL" + curl -fsSL "https://github.com/${REPO_ORG}/${REPO_NAME}/archive/refs/tags/${TAG}.tar.gz" -o "$TMPDIR_INSTALL/release.tar.gz" || { + echo "ERROR: could not download release $TAG from GitHub" >&2 + exit 1 + } + tar -xzf "$TMPDIR_INSTALL/release.tar.gz" -C "$TMPDIR_INSTALL" || { + echo "ERROR: failed to extract release $TAG" >&2 + exit 1 + } # The tarball extracts as $REPO_NAME-$TAG/, rename to clean path EXTRACTED_DIR="$TMPDIR_INSTALL/${REPO_NAME}-${TAG}" if [ -d "$EXTRACTED_DIR" ]; then mv "$EXTRACTED_DIR" "$DOTFILES" fi if [ ! -f "$DOTFILES/install.sh" ]; then - echo "ERROR: could not download release $TAG from GitHub" >&2 + echo "ERROR: release $TAG does not contain install.sh" >&2 exit 1 fi fi @@ -503,7 +509,7 @@ release_ghostty_pending_lock() { GHOSTTY_PENDING_LOCK_HELD=false } -trap 'release_ghostty_pending_lock' EXIT +trap 'release_ghostty_pending_lock; rm -rf "${TMPDIR_INSTALL:-}"' EXIT defer_ghostty_target() { local src="$1"