How to use the commitizen/dist/cli/git-cz.bootstrap function in commitizen

To help you get started, we’ve selected a few commitizen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spotify / web-scripts / packages / web-scripts / src / Tasks / CommitTasks.ts View on Github external
export function commitTask(task: CommitTaskDesc): void {
  dbg('running commitizen commit');

  // use this to get the resolved path to the root of the commitizen directory
  const cliPath = require
    .resolve('commitizen/package.json')
    .replace('package.json', '');

  return czBootstrap(
    {
      cliPath,
      config: {
        path: task.path,
      },
    },
    // this gets the arguments in the right positions to
    // satisfy commitizen, which strips the first two
    // (assumes that they're `['node', 'git-cz']`)
    [null, ...task.restOptions],
  );
}
github SUI-Components / sui / packages / sui-mono / bin / sui-mono-commit.js View on Github external
async function initCommit() {
  const {hasFiles: hasStagedFiles} = await getDiffedFiles({checkIfStaged: true})
  if (hasStagedFiles === false) {
    console.log('No files added to staging! Did you forget to run git add?\n')
    const modified = await getDiffedFiles()
    if (modified.hasFiles) {
      console.log('Showing the files that you could add:')
      console.log(modified.files)
    }
    return
  }

  bootstrap({
    debug: false,
    cliPath: path.join(process.cwd(), 'node_modules/commitizen'),
    config: {
      path: require.resolve('@s-ui/cz')
    }
  })
}

commitizen

Git commit, but play nice with conventions.

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis