From 4929d037821f35971f47b059da4783e62f90de5b Mon Sep 17 00:00:00 2001 From: shixy <40977249+shixy96@users.noreply.github.com> Date: Wed, 26 Aug 2020 03:45:37 +0800 Subject: [PATCH] fix: git-cz commit repoPath (#676) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: git-cz commit repoPath * chore(deps): bump minimist from 1.2.0 to 1.2.3 (#721) Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.3. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): update dependency nyc to v15 (#704) Co-authored-by: Renovate Bot * fix: add babel spread plugin * fix: move to babel.config.js * fix: update azure devops images * docs: add commitiquette (#727) * fix(deps): bump vulnerable packages * feature: remove dependency on ShellJS (#729) * feature: avoid dependning on shelljs * refactor: remove shelljs from tests * refactor: simplify configLoader call * fix: use shell flag when spawning npm init Co-authored-by: hdmr14 <58992133+hdmr14@users.noreply.github.com> * refactor: remove unused function isArray * refactor: remove unused function isString Co-authored-by: hdmr14 <58992133+hdmr14@users.noreply.github.com> * feat: remove dependency on ShellJS (#729) Empty commit to trigger release. * fix(deps): update dependency cz-conventional-changelog to v3.2.0 (#657) Co-authored-by: Renovate Bot * fix: restore commitizen.congifLoader.load to public API (#733) * fix: restore commitizen.congifLoader.load to public API This reverts commit 468e92417dbcdacb2cbcf06fdcc582eca423df4a. * chore: temporarily skip failing test * fix: make cwd argument optional again (#735) * docs: add .czrc support to README (#739) * fix(deps): upgrade lodash to 4.17.20 and update package lock file * docs: add cz-format-extension (#758) * docs: Update `commitlint` adapter link (#751) * docs: Update `commitlint` adapter link * docs: Update link to commitlint adapter * docs: add adapter for jira (#748) We have created an adapter that is purposed for the JIRA workflow when you don't use _smart commits_. We have made sure that the adapter is well documented and easy to use. We think that it is unique and would love for it to be recognized. * chore(deps): update dependency nyc to v15.1.0 (#745) Co-authored-by: Renovate Bot * fix(cli): determine correct location of `COMMIT_EDITMSG` (#737) If using git working trees, then `.git` is a file and not a directory: This file references its own git directory within the main working tree. `$ git rev-parse --git-dir` will always return the directory where the `COMMIT_EDITMSG` file should be placed. * chore(deps): update dependency babel-plugin-istanbul to v5.2.0 (#658) Co-authored-by: Renovate Bot * chore(deps): update dependency semver to v6.3.0 (#659) Co-authored-by: Renovate Bot * fix(deps): update dependency inquirer to v6.5.2 (#664) Co-authored-by: Renovate Bot * feat: use cz as binary name (#767) While still support the old git-cz binary name. Also improve the documentation. Closes #761 * fix: git-cz commit repoPath Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot Co-authored-by: jimthedev Co-authored-by: Martin McWhorter Co-authored-by: Linus Unnebäck Co-authored-by: hdmr14 <58992133+hdmr14@users.noreply.github.com> Co-authored-by: Fernando Maia Co-authored-by: Jimmy Andrade Co-authored-by: tyankatsu Co-authored-by: Dura Co-authored-by: Julius Recep Colliander Celik Co-authored-by: nutlike Co-authored-by: Felipe Santos --- src/cli/strategies/git-cz.js | 4 ++-- src/commitizen/adapter.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/strategies/git-cz.js b/src/cli/strategies/git-cz.js index df9e2df5..dad0ebf1 100644 --- a/src/cli/strategies/git-cz.js +++ b/src/cli/strategies/git-cz.js @@ -8,7 +8,7 @@ import * as gitStrategy from './git'; // destructure for shorter apis let { parse } = gitCzParser; -let { getPrompter, resolveAdapterPath } = adapter; +let { getPrompter, resolveAdapterPath, getGitRootPath } = adapter; let { isClean } = staging; export default gitCz; @@ -55,7 +55,7 @@ function gitCz (rawGitArgs, environment, adapterConfig) { let adapterPackageJson = getParsedPackageJsonFromPath(resolvedAdapterRootPath); let cliPackageJson = getParsedPackageJsonFromPath(environment.cliPath); console.log(`cz-cli@${cliPackageJson.version}, ${adapterPackageJson.name}@${adapterPackageJson.version}\n`); - commit(inquirer, process.cwd(), prompter, { + commit(inquirer, getGitRootPath(), prompter, { args: parsedGitCzArgs, disableAppendPaths: true, emitData: true, diff --git a/src/commitizen/adapter.js b/src/commitizen/adapter.js index 717f7341..8818615b 100644 --- a/src/commitizen/adapter.js +++ b/src/commitizen/adapter.js @@ -17,6 +17,7 @@ export { resolveAdapterPath, getYarnAddStringMappings, generateYarnAddAdapterCommand, + getGitRootPath, }; /**