diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c335a9..abd14f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [1.0.0.13] - 2026-07-09 + +### Fixed +- `outreach-upgrade` no longer risks silently losing a user's `persona.json`/`conversation_planner.json` edits during an upgrade. Their content is backed up before `git stash`/`git pull` and restored to the live path afterward regardless of how git's stash/rename resolution goes — previously, if upstream renamed a tracked config to `.example`, the user's stashed edits could end up stuck in the stash (or merged into the `.example` file) with nothing at the live path, silently falling back to default config. The script also auto-runs `git stash pop` after the pull instead of just printing a reminder. + ## [1.0.0.12] - 2026-07-07 ### Changed diff --git a/VERSION b/VERSION index 6ebe80a..d612e00 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0.12 +1.0.0.13 diff --git a/bin/outreach-upgrade b/bin/outreach-upgrade index 4934fcc..13ead05 100755 --- a/bin/outreach-upgrade +++ b/bin/outreach-upgrade @@ -108,6 +108,21 @@ if [[ -x "$CONFIG_BIN" ]]; then fi [[ "${EBASE_INSTALL_LOCAL:-${LINKEDIN_OUTREACH_INSTALL_LOCAL:-0}}" == "1" ]] && INSTALL_LOCAL="true" +# Local, gitignored user config — upstream has renamed these tracked +# files before (persona.json/conversation_planner.json -> *.example) and a +# stash-only strategy can leave a user's live edits stuck in the stash with +# nothing at the live path. Back them up and restore verbatim regardless of +# how git's stash/rename resolution goes. +CONFIG_FILES=(outreach/config/persona.json outreach/config/conversation_planner.json) +CONFIG_BACKUP_DIR="$(mktemp -d)" +trap 'rm -rf "$CONFIG_BACKUP_DIR"' EXIT +for f in "${CONFIG_FILES[@]}"; do + if [[ -f "${REPO_ROOT}/${f}" ]]; then + mkdir -p "$(dirname "${CONFIG_BACKUP_DIR}/${f}")" + cp "${REPO_ROOT}/${f}" "${CONFIG_BACKUP_DIR}/${f}" + fi +done + STASH_OUTPUT="" cd "$REPO_ROOT" if [[ -n "$(git status --porcelain 2>/dev/null || true)" ]]; then @@ -119,6 +134,21 @@ if ! git pull --ff-only origin "$REMOTE_BRANCH"; then exit 1 fi +if [[ "$STASH_OUTPUT" == *"Saved working directory"* ]]; then + if git stash pop 2>&1; then + STASH_OUTPUT="" + else + echo "[outreach-upgrade] WARNING: 'git stash pop' hit a conflict — resolve manually in ${REPO_ROOT} (stash kept)." >&2 + fi +fi + +for f in "${CONFIG_FILES[@]}"; do + if [[ -f "${CONFIG_BACKUP_DIR}/${f}" ]]; then + mkdir -p "$(dirname "${REPO_ROOT}/${f}")" + cp "${CONFIG_BACKUP_DIR}/${f}" "${REPO_ROOT}/${f}" + fi +done + if command -v uv >/dev/null 2>&1; then uv sync else @@ -175,8 +205,4 @@ mkdir -p "$STATE_DIR" echo "$OLD_VERSION" >"$MARKER_FILE" rm -f "$CACHE_FILE" "$SNOOZE_FILE" -if [[ "$STASH_OUTPUT" == *"Saved working directory"* ]]; then - echo "[outreach-upgrade] Note: local changes were stashed. Run 'git stash pop' in ${REPO_ROOT} to restore." -fi - echo "UPGRADED $OLD_VERSION $NEW_VERSION" diff --git a/pyproject.toml b/pyproject.toml index 9d2d8dc..0da3463 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ebase" -version = "1.0.0.12" +version = "1.0.0.13" description = "LinkedIn recruiting outreach that runs inside Claude Code" readme = "README.md" license = "MIT"