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(cli-43): skip git ops when not a git repo #398

Merged
merged 3 commits into from
May 10, 2021

Conversation

varl
Copy link
Contributor

@varl varl commented May 10, 2021

Introduce a gitEnabled() function used to identify if Git operations
like linting commits and installing hooks should be done.

Modifies how the PROJECT_ROOT is identified when there is no .git
directory by adding additional root-level files like yarn.lock and
package-lock.json.

Jira-Issue: CLI-43

Introduce a gitEnabled() function used to identify if Git operations
like linting commits and installing hooks should be done.

Modifies how the PROJECT_ROOT is identified when there is no .git
directory by adding additional root-level files like yarn.lock and
package.json.

May be a risk for false positives in a monorepo, will need to monitor
that a bit.

Jira-Issue: CLI-43
varl added 2 commits May 10, 2021 10:27
The yarn.lock should only exist at the root level even in workspaces,
and if someone is using NPM the same should be true for the
package-lock.json.

The .d2 directory is not a good indicator of the project root, so
removing that from the checks.
@varl varl merged commit 6488144 into master May 10, 2021
@varl varl deleted the cli-43-skip-git-when-no-git branch May 10, 2021 08:34
Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

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

Approving posthumous ;-)

dhis2-bot added a commit that referenced this pull request May 10, 2021
## [8.1.1](v8.1.0...v8.1.1) (2021-05-10)

### Bug Fixes

* **cli-43:** skip git ops when not a git repo ([0617519](0617519))
* **cli-43:** skip git ops when not a git repo ([#398](#398)) ([6488144](6488144))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 8.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants