@storm-software/git-tools
Version:
Tools for managing Git repositories within a Nx workspace.
44 lines (30 loc) • 1.97 kB
JavaScript
; function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
var _chunkMJ243FGHcjs = require('./chunk-MJ243FGH.cjs');
var _chunkWZ6ONU2Gcjs = require('./chunk-WZ6ONU2G.cjs');
require('./chunk-P2CHIYIK.cjs');
require('./chunk-HI7REZLL.cjs');
require('./chunk-LUO23224.cjs');
require('./chunk-7KAXYFA6.cjs');
require('./chunk-ITOSNR37.cjs');
require('./chunk-H4QPTCFG.cjs');
var _chunkKK4YC43Scjs = require('./chunk-KK4YC43S.cjs');
// bin/pre-commit.ts
_chunkKK4YC43Scjs.init_cjs_shims.call(void 0, );
void (async () => {
const config = await _chunkWZ6ONU2Gcjs.getConfig.call(void 0, );
try {
_chunkWZ6ONU2Gcjs.handleProcess.call(void 0, config);
_chunkWZ6ONU2Gcjs.writeInfo.call(void 0, "Running pre-commit hook...", config);
_chunkMJ243FGHcjs.checkPackageVersion.call(void 0, process.argv.slice(1));
if (_chunkMJ243FGHcjs.isPackageVersionChanged.call(void 0, _optionalChain([process, 'access', _ => _.argv, 'optionalAccess', _2 => _2.slice, 'call', _3 => _3(1)]))) {
_chunkWZ6ONU2Gcjs.writeError.call(void 0, "Please regenerate the package lock file before committing...", config);
_chunkWZ6ONU2Gcjs.exitWithError.call(void 0, config);
}
_chunkWZ6ONU2Gcjs.exitWithSuccess.call(void 0, config);
} catch (error) {
_chunkWZ6ONU2Gcjs.writeFatal.call(void 0, `A fatal error occurred while running the program: ${error.message}`, config);
_chunkWZ6ONU2Gcjs.exitWithError.call(void 0, config);
process.exit(1);
}
})();