From 679395fa081ce8de85cf68792ba21ae936ff0485 Mon Sep 17 00:00:00 2001 From: screw-hand Date: Sat, 8 Jul 2023 16:01:39 +0800 Subject: [PATCH 1/7] chore: pnpm init by v8.6.1 --- pnpm-lock.yaml | 356 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 pnpm-lock.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..6b256c9 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,356 @@ +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + commander: + specifier: ^7.2.0 + version: 7.2.0 + console-table-printer: + specifier: ^2.9.0 + version: 2.9.0 + git-config-path: + specifier: ^2.0.0 + version: 2.0.0 + ini: + specifier: ^2.0.0 + version: 2.0.0 + is-git-repository: + specifier: ^2.0.0 + version: 2.0.0 + lodash: + specifier: ^4.17.21 + version: 4.17.21 + parse-git-config: + specifier: ^3.0.0 + version: 3.0.0 + shelljs: + specifier: ^0.8.4 + version: 0.8.4 + +devDependencies: + '@types/node': + specifier: ^15.12.4 + version: 15.12.4 + +packages: + + /@types/node@15.12.4: + resolution: {integrity: sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA==} + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: false + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: false + + /commander@7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} + dev: false + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: false + + /console-table-printer@2.9.0: + resolution: {integrity: sha512-20o73riqnclLYJt5ggNqP2ZjtgL5OxJPWzTVi3LyVFVtubMH0XN+oOn9outL1XI5ldJgPcjdMAWc92vRscHAKA==} + dependencies: + simple-wcswidth: 1.0.1 + dev: false + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: false + + /end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + dependencies: + once: 1.4.0 + dev: false + + /execa@4.1.0: + resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 5.2.0 + human-signals: 1.1.1 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: false + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: false + + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: false + + /get-stream@5.2.0: + resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} + engines: {node: '>=8'} + dependencies: + pump: 3.0.0 + dev: false + + /git-config-path@2.0.0: + resolution: {integrity: sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA==} + engines: {node: '>=4'} + dev: false + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + + /has@1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: false + + /human-signals@1.1.1: + resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} + engines: {node: '>=8.12.0'} + dev: false + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: false + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: false + + /ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: false + + /ini@2.0.0: + resolution: {integrity: sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==} + engines: {node: '>=10'} + dev: false + + /interpret@1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + dev: false + + /is-absolute@1.0.0: + resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} + engines: {node: '>=0.10.0'} + dependencies: + is-relative: 1.0.0 + is-windows: 1.0.2 + dev: false + + /is-core-module@2.12.1: + resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} + dependencies: + has: 1.0.3 + dev: false + + /is-git-repository@2.0.0: + resolution: {integrity: sha512-HDO50CG5suIAcmqG4F1buqVXEZRPn+RaXIn9pFKq/947FBo2bCRwK7ZluEVZOy99a4IQyqsjbKEpAiOXCccOHQ==} + dependencies: + execa: 4.1.0 + is-absolute: 1.0.0 + dev: false + + /is-relative@1.0.0: + resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} + engines: {node: '>=0.10.0'} + dependencies: + is-unc-path: 1.0.0 + dev: false + + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: false + + /is-unc-path@1.0.0: + resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} + engines: {node: '>=0.10.0'} + dependencies: + unc-path-regex: 0.1.2 + dev: false + + /is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: false + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: false + + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: false + + /merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: false + + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: false + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: false + + /npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: false + + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: false + + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: false + + /parse-git-config@3.0.0: + resolution: {integrity: sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA==} + engines: {node: '>=8'} + dependencies: + git-config-path: 2.0.0 + ini: 1.3.8 + dev: false + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: false + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: false + + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: false + + /pump@3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: false + + /rechoir@0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + dependencies: + resolve: 1.22.2 + dev: false + + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.12.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: false + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: false + + /shelljs@0.8.4: + resolution: {integrity: sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==} + engines: {node: '>=4'} + hasBin: true + dependencies: + glob: 7.2.3 + interpret: 1.4.0 + rechoir: 0.6.2 + dev: false + + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: false + + /simple-wcswidth@1.0.1: + resolution: {integrity: sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==} + dev: false + + /strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: false + + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: false + + /unc-path-regex@0.1.2: + resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} + engines: {node: '>=0.10.0'} + dev: false + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: false + + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: false From 958ec509eaa9232058162dde1cafb90c434052e9 Mon Sep 17 00:00:00 2001 From: screw-hand Date: Sat, 8 Jul 2023 16:34:57 +0800 Subject: [PATCH 2/7] feat: display the global user message in list command --- src/index.js | 7 +++++-- src/utils.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index bf76eb6..2e2e6a7 100644 --- a/src/index.js +++ b/src/index.js @@ -40,13 +40,16 @@ program.command('delete ').description('Delete one group').action(on program.parse(process.argv); function onList() { - const allConfig = getAllConfigInfo(); + const { allInfo , globalInfo } = getAllConfigInfo(); const using = getUsingGitUserConfig(); - const tableData = getPrintTableData(allConfig); + const tableData = getPrintTableData(allInfo); // currently used user info printer(`Currently used name=${using.name} email=${using.email}`, 'yellow'); + // Globally used user info + printer(`Globally used name=${globalInfo.name} email=${globalInfo.email}`, 'yellow'); + // git user config group list const pt = new Table(); pt.addRows(tableData, { color: 'cyan' }); diff --git a/src/utils.js b/src/utils.js index 85cecb0..bf66225 100644 --- a/src/utils.js +++ b/src/utils.js @@ -19,7 +19,7 @@ function getAllConfigInfo() { const globalInfo = getGlobalGitUserConfig(); const currentGumrcInfo = getGumrcInfo(); const allInfo = merge({ global: globalInfo }, currentGumrcInfo); - return allInfo; + return { allInfo, globalInfo }; } function getUsingGitUserConfig() { From 8fb5957e13bb629fbb307405ce7afb4d1920db9f Mon Sep 17 00:00:00 2001 From: screw-hand Date: Sat, 8 Jul 2023 18:49:24 +0800 Subject: [PATCH 3/7] feat: support the alias of command --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index bf76eb6..38f2a4b 100644 --- a/src/index.js +++ b/src/index.js @@ -20,10 +20,11 @@ const program = new commander.Command('gum'); program.version(pkg.version); -program.command('list').description('List all the user config group').action(onList); +program.command('list').aliases(['ls', 'l']).description('List all the user config group').action(onList); program .command('set ') + .aliases(['s']) .description('Set one group for user config') .option('--name ', 'user name') .option('--email ', 'user email') @@ -31,11 +32,12 @@ program program .command('use ') + .aliases(['u']) .description('Use one group name for user config') .option('--global', 'git global config') .action(onUse); -program.command('delete ').description('Delete one group').action(onDelete); +program.command('delete ').aliases(['del', 'd']).description('Delete one group').action(onDelete); program.parse(process.argv); From 74033b3440d3a181a87d07dd08b7103e807d2f4c Mon Sep 17 00:00:00 2001 From: screw-hand Date: Sat, 8 Jul 2023 18:58:15 +0800 Subject: [PATCH 4/7] feat: support the use command use short option --- src/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 38f2a4b..85509fa 100644 --- a/src/index.js +++ b/src/index.js @@ -35,6 +35,7 @@ program .aliases(['u']) .description('Use one group name for user config') .option('--global', 'git global config') + .option('-g', 'git global config') .action(onUse); program.command('delete ').aliases(['del', 'd']).description('Delete one group').action(onDelete); @@ -87,20 +88,21 @@ function onSet(groupName, options) { function onUse(groupName, options) { const allConfigInfo = getAllConfigInfo(); const user = allConfigInfo[groupName]; + const isGlobal = options.global || options.g; if (!shell.which('git')) { shell.echo('Sorry, this script requires git'); shell.exit(1); } - if (!options.global && !isGit()) { + if (!isGlobal && !isGit()) { printer(`Current project not a git repository (or any of the parent directories)`, 'red'); console.log(' '); process.exit(1); } if (user) { - const g = options.global ? `--global` : ''; + const g = isGlobal ? `--global` : ''; if (shell.exec(`git config ${g} user.name "${user.name}"`).code !== 0) { shell.echo('Error: Git config user.name failed'); @@ -112,7 +114,7 @@ function onUse(groupName, options) { const using = getUsingGitUserConfig(); - if (options.global) { + if (isGlobal) { const globalGitUser = getGlobalGitUserConfig(); printer(`Global using name=${globalGitUser.name} email=${globalGitUser.email}`, 'green'); } From 4734ff82df96334c4bfb4b18b489eb9f75a0f3db Mon Sep 17 00:00:00 2001 From: screw-hand Date: Sat, 8 Jul 2023 22:50:37 +0800 Subject: [PATCH 5/7] pref: last commit --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 2e2e6a7..250cea5 100644 --- a/src/index.js +++ b/src/index.js @@ -40,7 +40,7 @@ program.command('delete ').description('Delete one group').action(on program.parse(process.argv); function onList() { - const { allInfo , globalInfo } = getAllConfigInfo(); + const { allInfo, globalInfo } = getAllConfigInfo(); const using = getUsingGitUserConfig(); const tableData = getPrintTableData(allInfo); @@ -48,7 +48,7 @@ function onList() { printer(`Currently used name=${using.name} email=${using.email}`, 'yellow'); // Globally used user info - printer(`Globally used name=${globalInfo.name} email=${globalInfo.email}`, 'yellow'); + printer(`Global used name=${globalInfo.name} email=${globalInfo.email}`, 'yellow'); // git user config group list const pt = new Table(); From 2ec2f1acf70e7ef882ba28c075c473c9907c2a24 Mon Sep 17 00:00:00 2001 From: screw-hand Date: Sat, 8 Jul 2023 23:11:30 +0800 Subject: [PATCH 6/7] feat: change the global use color with red --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 250cea5..afe0b91 100644 --- a/src/index.js +++ b/src/index.js @@ -48,7 +48,7 @@ function onList() { printer(`Currently used name=${using.name} email=${using.email}`, 'yellow'); // Globally used user info - printer(`Global used name=${globalInfo.name} email=${globalInfo.email}`, 'yellow'); + printer(`Global used name=${globalInfo.name} email=${globalInfo.email}`, 'red'); // git user config group list const pt = new Table(); From 0abcb4d240556c3a7a1bc03b7d3837857fab7642 Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 8 Jul 2023 23:22:48 +0800 Subject: [PATCH 7/7] fix: gum use con't find the gum config group --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index afe0b91..720ae49 100644 --- a/src/index.js +++ b/src/index.js @@ -86,8 +86,8 @@ function onSet(groupName, options) { } function onUse(groupName, options) { - const allConfigInfo = getAllConfigInfo(); - const user = allConfigInfo[groupName]; + const { allInfo } = getAllConfigInfo(); + const user = allInfo[groupName]; if (!shell.which('git')) { shell.echo('Sorry, this script requires git');