Skip to content

Problem using git cz in non-node submodule of project #449

@booc0mtaco

Description

@booc0mtaco

I have a project with the following configuration on my machine:

  • globally-installed commitizen with .czrc in ~ using cz-conventional-changelog
  • main repo. with package.json set up to use cz-conventional-changelog
  • a submodule that contains a non-node project (no package.json file)

in the main repo, git cz works as one would expect. however, if you try to do work in the submodule director, and run git cz it fails with a path error:

/Users/<username>/.nvm/versions/node/v6.6.0/lib/node_modules/commitizen/dist/commitizen/adapter.js:192
    throw error;
    ^

Error: Could not resolve /Users/<username>/Development/path/to/repo/submodule/node_modules/cz-conventional-changelog. Cannot find module '/Users/<username>/Development/path/to/repo/submodule/node_modules/cz-conventional-changelog'

It's trying to find an install directly in the submodule for some reason. I would have expected it to use the global install, or the installation referenced one directory up (as a submodule of a project that is commitizen-friendly).

As a test, I checked out the same submodule in a separate directory, and git cz worked as expected.


Is there something that would prevent submodules from working like nested directories when using git cz?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions