Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-init): check git repository using git cli #6526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BasixKOR
Copy link
Contributor

What's the problem this PR addresses?

Fixes #6521.

...

How did you fix it?

Use Git CLI instead to detect if git init is nesscary.
...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@@ -248,7 +248,8 @@ export default class InitCommand extends BaseCommand {
quiet: true,
});

if (!xfs.existsSync(ppath.join(this.context.cwd, `.git`))) {
const isGitRepo = (await execUtils.execvp(`git`, [`rev-parse`, `--is-inside-work-tree`], {cwd: this.context.cwd})).code === 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably too terse to be merged directly, but I wasn't sure which style I should pick since there's no automated formatter available. I'll apply your stylistic suggestion if you have one.

@arcanis
Copy link
Member

arcanis commented Oct 1, 2024

Seems like a reasonable approach - can you add a test to avoid regressions?

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.

[Bug?]: Integration glitches with nested projects
2 participants