{"version":3,"sources":["jsdelivr-header.js","/npm/recovery-from-git@1.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;OCJS,YAAe,mBACf,aAAgB,uBAClB,SAAU,cACV,OAAQ,YACN,SAAY,UAErB,MAAM,QAAU,IAAI,QAEpB,QACG,YAAY,8CACZ,KAAK,gBACL,OAAO,oBAAqB,2BAE/B,QAAQ,MAAM,QAAQ,MAEtB,MAAM,QAAU,QAAQ,OAGlB,IAAM,KAAK,SAAS,QAAQ,OAElC,QAAQ,IAAI,+BAEZ,MAAM,KAAO,IAAI,MAAM,EAAG,IAAI,OAAS,GAEnC,GAAG,WAAW,GAAG,eACnB,QAAQ,KAAK,cAAc,mFAG3B,SAAS,uBAAuB,qBAElC,QAAQ,IAAI,iCAEZ,IAAI,aAAe,KAGnB,aAAe,QAAQ,MAAQ,KAE3B,GAAG,WAAW,MAAM,kBACtB,QAAQ,KAAK,eAAe,uFAC5B,KAAK,IAGP,QAAQ,IAAI,+BAA+B,6CAG3C,SACE,eAAe,kBAAkB,kBACjC,CAAE,MAAO,YAGX,QAAQ,KAAK,iFAAiF,8BAE9F,KAAK","file":"/npm/recovery-from-git@1.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/recovery-from-git@1.0.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport { execSync } from 'child_process';\nimport path from 'path';\nimport fs from 'fs';\nimport { exit } from 'process';\n\nconst program = new Command();\n\nprogram\n  .description('recovery code registry from .git directory')\n  .name('recovery-git')\n  .option('-n, --name [name]', 'rename code repo\\'s name');\n\nprogram.parse(process.argv);\n\nconst options = program.opts();\n\n// get workdir\nconst dir = path.basename(process.cwd());\n\nconsole.log('[Info]: creating bunlde....');\n\nconst repo = dir.slice(0, dir.length - 4);\n\nif (fs.existsSync(`${repo}.bundle`)) {\n  console.warn(`[Warning]: ${repo}.bundle file already exists, make sure it is correct, skip create bundle...`);\n} else {\n  // create bunlde\n  execSync(`git bundle create ./${repo}.bundle --all`);\n}\nconsole.log('[Info]: checking directory...');\n\nlet registryName = repo;\n\n// set code repo name\nregistryName = options.name || repo;\n\nif (fs.existsSync(`../${registryName}`)) {\n  console.warn(`[Error]: ../${registryName} directory already exists, please remove it and execute recovery again!`);\n  exit(0);\n}\n\nconsole.log(`[Info]: check completed, ../${registryName} directory will be created...`);\n\n// clone repo from bundle\nexecSync(\n  `git clone ./${repo}.bundle ../${registryName} -v`,\n  { stdio: 'inherit' },\n);\n\nconsole.info(`\\n\\n[Success]: √ please execute follow command to check git status.\\n\\n cd ../${registryName} \\n git status`);\n\nexit(0);\n"]}