UNPKG

@storm-software/git-tools

Version:

Tools for managing Git repositories within a Nx workspace.

56 lines (41 loc) 2.34 kB
#!/usr/bin/env node "use strict"; 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 _chunkHTVOKCRJcjs = require('./chunk-HTVOKCRJ.cjs'); var _chunkGWDOCACNcjs = require('./chunk-GWDOCACN.cjs'); var _chunk53F2DJBEcjs = require('./chunk-53F2DJBE.cjs'); require('./chunk-FMYKTN2Z.cjs'); require('./chunk-MXO7CLUN.cjs'); require('./chunk-GSZ2Y7H4.cjs'); require('./chunk-H4MEIOPL.cjs'); require('./chunk-TVPM4C6Y.cjs'); require('./chunk-UQFYXF6V.cjs'); var _chunkIG6EXAQUcjs = require('./chunk-IG6EXAQU.cjs'); // bin/post-commit.ts _chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, ); void (async () => { const config = await _chunk53F2DJBEcjs.getConfig.call(void 0, ); try { _chunk53F2DJBEcjs.handleProcess.call(void 0, config); _chunk53F2DJBEcjs.writeInfo.call(void 0, "Running post-commit hook...", config); _chunkHTVOKCRJcjs.checkPackageVersion.call(void 0, _optionalChain([process, 'access', _ => _.argv, 'optionalAccess', _2 => _2.slice, 'call', _3 => _3(1)])); try { _chunkGWDOCACNcjs.run.call(void 0, config, "git-lfs version"); } catch (error) { _chunk53F2DJBEcjs.writeError.call(void 0, `This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit. Error: ${_optionalChain([error, 'optionalAccess', _4 => _4.message])}`, config ); _chunk53F2DJBEcjs.exitWithError.call(void 0, config); } _chunkGWDOCACNcjs.run.call(void 0, config, "git lfs post-commit"); _chunk53F2DJBEcjs.exitWithSuccess.call(void 0, config); } catch (error) { _chunk53F2DJBEcjs.writeFatal.call(void 0, `A fatal error occurred while running the program: ${error.message}`, config ); _chunk53F2DJBEcjs.exitWithError.call(void 0, config); process.exit(1); } })();