UNPKG

jetup

Version:

Jetup: JavaScript Project Setup! Jetting-up your next JS project in seconds with one command, using fully modular, customizable presets, instantly ready to code!.

27 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HuskyModule = void 0; const framework_1 = require("../../framework"); const utils_1 = require("../../utils"); class HuskyModule extends framework_1.BaseModule { constructor() { super(...arguments); this.autoInstallDeps = true; this.registry = HuskyModule; } async setup() { if (!(0, utils_1.isFolderExists)((0, utils_1.cwd)('.husky'))) { this.logger.info(`executing: npx husky init`); await (0, utils_1.runCommandInSilent)('npx husky init'); this.logger.info(`modifying pre-commit file contents`); await (0, utils_1.createOrReplaceFile)((0, utils_1.cwd)('.husky/pre-commit'), (0, utils_1.readFile)(__dirname, './pre-commit')); this.logger.info(`modifying pre-commit file permission`); await (0, utils_1.changeFilePermission)((0, utils_1.cwd)('.husky/pre-commit'), 0o755); } else { this.logger.info(`.husky folder already exists`); } } } exports.HuskyModule = HuskyModule; //# sourceMappingURL=index.js.map