Skip to content

fix(publish): explain why the clean repo check fails - #364

Open
hp-himani wants to merge 1 commit into
fastify:mainfrom
hp-himani:himanipanwar-clean-repo-check-errors
Open

hp-himani wants to merge 1 commit into
fastify:mainfrom
hp-himani:himanipanwar-clean-repo-check-errors

Conversation

@hp-himani

Copy link
Copy Markdown

Closes #112

Changes

  • Keep the full clean-repo check, as discussed in the issue, but report what differs instead of a generic sentence.
  • Add a separate branch check before the clean check. It explains the expected vs. found remote branch and how to fix it (switch branch, --branch, or releasify config --arg branch).
  • Add a message for a branch that tracks no remote branch (tracking is null), suggesting git push -u <remote> <branch>.

Before / after

Before (older Node.js):

The git repo must be clean (committed and pushed) before releasing!

After, with a modified file:

The git repo must be clean (committed and pushed) before releasing!
- modified: ["package.json"]
- files: [{"path":"package.json","index":" ","working_dir":"M"}]
Check "git status", then commit, push or pull before trying again.

After, with the wrong tracked branch:

Your local branch tracks "origin/master", but releasify expects "origin/main".
Either switch to the branch you want to release, or tell releasify which one to use:
- for this run only: add --branch <name> (and --remote <name> if needed)
- as your new default: run "releasify config --arg branch"

Testing

  • New tests: wrong tracked branch, no tracked branch, and the fields listed in
    the dirty-repo error.
  • npm test: 63/63 pass, 100% coverage. npm run lint: clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error handling for "Clean Repo" check

1 participant