UNPKG

gint

Version:

A pluggable and configurable GIT linter tool

15 lines (10 loc) 307 B
'use strict'; const fs = require('fs'); const path = require('path'); const readFile = (filePath) => fs.readFileSync(filePath, 'utf8'); module.exports = (opts) => { if (opts.hookName === 'commit-msg') { return readFile(path.join(opts.cwd, opts.hookParamsRaw)); } return opts.hookParamsRaw; };