Skip to content

fix(new): fail when the git repository setup fails - #288

Merged
Exeloo merged 1 commit into
NanoForge-dev:mainfrom
sarankumar1325:fix/new-git-failure-285
Nov 22, 2026
Merged

Exeloo merged 1 commit into
NanoForge-dev:mainfrom
sarankumar1325:fix/new-git-failure-285

Conversation

@sarankumar1325

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #285.

nf new --git ignored the result of setupGitRepository, so a failed git init or git remote add (no git binary, a bad remote) showed a failed spinner and then the success message, with exit code 0.

handle now uses that result: res = (await this.setupGitRepository(...)) && res. The git setup still runs after a failed install, as before, so the user still gets a repository where possible. Either failure makes the command fail.

How do you test this PR?

New src/action/actions/new.action.spec.ts stubs collectValues, scaffold, installDependencies and setupGitRepository:

  • A failed git setup gives { success: false } ({ success: true } on main, so this test fails there).
  • A successful git setup gives { success: true }, and a failed install with a successful git setup stays { success: false }.
  • Without --git, the git setup isn't called.

pnpm run test:unit (264 passed, after building libs/registry and libs/config), tsc --noEmit, prettier and eslint pass.

I used an AI coding assistant for this change. I reviewed the diff and ran the tests above.

Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>
@github-actions github-actions Bot added the command:new Related to new command label Nov 11, 2026
@Exeloo
Exeloo merged commit 4ff4fd3 into NanoForge-dev:main Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:new Related to new command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nf new --git reports success when git init or git remote fails

2 participants