-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli-43): skip git ops when not a git repo (#398)
* fix(cli-43): skip git ops when not a git repo 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 * refactor: check for lock files 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.
- Loading branch information
Showing
5 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { dirExists } = require('./files.js') | ||
const { GIT_DIR } = require('./paths.js') | ||
|
||
exports.gitEnabled = () => dirExists(GIT_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters