Skip to content

pathspec 'cz' did not match any file(s) known to git #607

@AlvinYuXT

Description

@AlvinYuXT

I am using bootstrap method in a file named cz.js like this

const path = require('path')
const bootstrap = require('commitizen/dist/cli/git-cz').bootstrap

bootstrap({
    cliPath: path.join(__dirname, '../node_modules/commitizen'),
    // this is new
    config: {
        path: 'cz-conventional-changelog'
    }
})

If I run node cz.js. It is correct.
But when I use them like this:

const program = require('commander')
program
    .command('cz')
    .action(() => {
        require('./cz')
    })

It shows error: pathspec 'cz' did not match any file(s) known to git.
The error info is:


Error: git exited with error code 1
    at ChildProcess.<anonymous> (/Users/yuxitong/worklife/netease/talos/node_modules/commitizen/dist/git/commit.js:46:26)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)

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