feat: adding linter for commits
This commit is contained in:
25
node_modules/husky/lib/installer/mainScript.js
generated
vendored
Normal file
25
node_modules/husky/lib/installer/mainScript.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const getBanner_1 = require("./getBanner");
|
||||
const read_pkg_1 = require("../read-pkg");
|
||||
function getMainScript() {
|
||||
const pkg = read_pkg_1.readPkg(path.join(__dirname, '../..'));
|
||||
const mainScript = fs
|
||||
.readFileSync(path.join(__dirname, '../../sh/husky.sh'), 'utf-8')
|
||||
.replace('huskyVersion="0.0.0"', `huskyVersion="${pkg.version}"`);
|
||||
return [getBanner_1.getBanner(), '', mainScript].join('\n');
|
||||
}
|
||||
exports.getMainScript = getMainScript;
|
||||
function createMainScript(gitHooksDir) {
|
||||
fs.writeFileSync(path.join(gitHooksDir, 'husky.sh'), getMainScript(), 'utf-8');
|
||||
}
|
||||
exports.createMainScript = createMainScript;
|
||||
function removeMainScript(gitHooksDir) {
|
||||
const filename = path.join(gitHooksDir, 'husky.sh');
|
||||
if (fs.existsSync(filename)) {
|
||||
fs.unlinkSync(filename);
|
||||
}
|
||||
}
|
||||
exports.removeMainScript = removeMainScript;
|
Reference in New Issue
Block a user