UNPKG

@storm-software/git-tools

Version:

Tools for managing Git repositories within a Nx workspace.

50 lines (35 loc) 2.3 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 _chunkMJ243FGHcjs = require('./chunk-MJ243FGH.cjs'); var _chunkFNIN2HF7cjs = require('./chunk-FNIN2HF7.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/post-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 post-commit hook...", config); _chunkMJ243FGHcjs.checkPackageVersion.call(void 0, _optionalChain([process, 'access', _ => _.argv, 'optionalAccess', _2 => _2.slice, 'call', _3 => _3(1)])); try { _chunkFNIN2HF7cjs.run.call(void 0, config, "git-lfs version"); } catch (error) { _chunkWZ6ONU2Gcjs.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); _chunkWZ6ONU2Gcjs.exitWithError.call(void 0, config); } _chunkFNIN2HF7cjs.run.call(void 0, config, "git lfs post-commit"); _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); } })();