'use strict';
import * as _0x3881d1 from 'fs';
import { cliMessages } from '../../../base-repo/constants/tools-constants.js';
import { cliLogError, cliLogInfo } from '../../../fd-toolbox/logging/cli-logger.js';

var __defProp=Object['defineProperty'],__name=(_0x53a890,_0x526772)=>__defProp(_0x53a890,'name',{'value':_0x526772,'configurable':!![]});const commitMessage=getCommitMessage();function validateCommitMessageFormat(_0x327daa){const _0x5732bf=/^[Mm]erge .*/,_0x383ba4=/^\d{1,5} ?- ?.*/;!_0x383ba4['test'](_0x327daa)&&!_0x5732bf['test'](_0x327daa)&&exitWithError('Commit\x20message\x20format\x20should\x20be:\x201234-your-message.\x20If\x20have\x20no\x20task\x20write:\x200\x20-\x20your\x20message');}__name(validateCommitMessageFormat,'validateCommitMessageFormat');function exitWithError(_0x3c8170){cliLogError(_0x3c8170),cliLogInfo(cliMessages['separatorLine']),cliLogInfo(cliMessages['separatorError']),cliLogInfo('FAIL\x20FAIL\x20FAIL\x20FAIL\x20FAIL\x20FAIL\x20FAIL\x20Commit\x20message\x20check\x20failed.\x20FAIL\x20FAIL\x20FAIL\x20FAIL\x20FAIL\x0a'),process['exit'](-0x1d0f+-0x151e*0x1+-0x85d*-0x6);}__name(exitWithError,'exitWithError');function getCommitMessage(){const _0x581fc8=process['argv'][-0x6c3*-0x3+-0xca3+-0x7a4];!_0x581fc8&&exitWithError('Commit\x20message\x20file\x20path\x20not\x20provided.');try{return _0x3881d1['readFileSync'](_0x581fc8,'utf-8')['trim']();}catch(_0x8ca711){const _0x5e47ca=_0x8ca711 instanceof Error?_0x8ca711['message']:String(_0x8ca711);return exitWithError('Could\x20not\x20read\x20commit\x20message\x20file:\x20'+_0x581fc8+'.\x20'+_0x5e47ca),'';}}__name(getCommitMessage,'getCommitMessage'),validateCommitMessageFormat(commitMessage),cliLogInfo('Commit\x20message\x20validation\x20passed.');

export { validateCommitMessageFormat };
