UNPKG

@interaktiv/dia-scripts

Version:

CLI toolbox with common scripts for most sort of projects at DIA

24 lines (17 loc) 716 B
"use strict"; const path = require('path'); const spawn = require('cross-spawn'); const { hasFile, resolveBin } = require('../../utils'); const args = process.argv.slice(2); const here = p => path.join(__dirname, p); const hereRelative = p => here(p).replace(process.cwd(), '.'); const useBuiltinConfig = args.includes('--config') === false && hasFile('commitlint.config.js') === false && hasFile('.commitlintrc.js') === false; const config = useBuiltinConfig ? ['--config', hereRelative('../../config/commitlintrc.js')] : []; const env = ['--env', 'HUSKY_GIT_PARAMS']; const result = spawn.sync(resolveBin('commitlint'), [...env, ...config, ...args], { stdio: 'inherit' }); process.exit(result.status);