@gkalpak/aliases 0.9.4 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +4 -4
  2. package/bin/aio/__a-builds-dir.js +5 -7
  3. package/bin/aio/aioall.js +5 -5
  4. package/bin/aio/aioatt.js +5 -5
  5. package/bin/aio/aiobd.js +5 -5
  6. package/bin/aio/aiord.js +5 -5
  7. package/bin/aio/aiorm.js +5 -5
  8. package/bin/config/cfgbash.js +3 -4
  9. package/bin/config/cfgbash.wsl.js +3 -4
  10. package/bin/config/cfggit.js +3 -4
  11. package/bin/config/cfggit.wsl.js +4 -5
  12. package/bin/config/cfgvim.js +5 -3
  13. package/bin/docker/dkrall.js +5 -5
  14. package/bin/docker/dkratt.js +5 -5
  15. package/bin/docker/dkrbd.js +5 -5
  16. package/bin/docker/dkrrd.js +5 -5
  17. package/bin/docker/dkrrm.js +5 -5
  18. package/bin/git/__g-pick-branch.js +5 -7
  19. package/bin/git/__g-pick-commit.js +5 -7
  20. package/bin/git/gaa.js +5 -5
  21. package/bin/git/gb.js +5 -5
  22. package/bin/git/gbc.js +5 -5
  23. package/bin/git/gbcm.js +5 -5
  24. package/bin/git/gbd.js +5 -5
  25. package/bin/git/gcl.js +5 -5
  26. package/bin/git/gcm.js +5 -5
  27. package/bin/git/gcma.js +5 -5
  28. package/bin/git/gcmane.js +5 -5
  29. package/bin/git/gcmf.js +5 -5
  30. package/bin/git/gcmfc.js +5 -5
  31. package/bin/git/gcmfs.js +5 -5
  32. package/bin/git/gcmi.js +5 -5
  33. package/bin/git/gcmia.js +5 -5
  34. package/bin/git/gcmiane.js +5 -5
  35. package/bin/git/gcmif.js +5 -5
  36. package/bin/git/gcmifc.js +5 -5
  37. package/bin/git/gcmifs.js +5 -5
  38. package/bin/git/gco.js +5 -5
  39. package/bin/git/gcoghpr-cleanup.js +5 -5
  40. package/bin/git/gcoghpr.js +5 -7
  41. package/bin/git/gcom.js +5 -5
  42. package/bin/git/gcopr.js +5 -5
  43. package/bin/git/gcp.js +5 -5
  44. package/bin/git/gcpa.js +5 -5
  45. package/bin/git/gcpc.js +5 -5
  46. package/bin/git/gcpx.js +5 -5
  47. package/bin/git/gcpxl.js +5 -5
  48. package/bin/git/gd.js +5 -5
  49. package/bin/git/gd1.js +5 -5
  50. package/bin/git/gdefb.js +5 -5
  51. package/bin/git/gdh.js +5 -5
  52. package/bin/git/gdn.js +5 -5
  53. package/bin/git/gdn1.js +5 -5
  54. package/bin/git/gdnh.js +5 -5
  55. package/bin/git/gl.js +5 -5
  56. package/bin/git/gl1.js +5 -5
  57. package/bin/git/gl1g.js +5 -5
  58. package/bin/git/gmt.js +5 -5
  59. package/bin/git/gngprh.js +5 -5
  60. package/bin/git/gngprm.js +5 -5
  61. package/bin/git/gp.js +5 -5
  62. package/bin/git/gp1.js +5 -5
  63. package/bin/git/gpf.js +5 -5
  64. package/bin/git/gpr.js +5 -5
  65. package/bin/git/gpro.js +5 -5
  66. package/bin/git/gprom.js +5 -5
  67. package/bin/git/gpru.js +5 -5
  68. package/bin/git/gprum.js +5 -5
  69. package/bin/git/grb.js +5 -5
  70. package/bin/git/grba.js +5 -5
  71. package/bin/git/grbc.js +5 -5
  72. package/bin/git/grbi.js +5 -5
  73. package/bin/git/grbia.js +5 -5
  74. package/bin/git/grbin.js +5 -5
  75. package/bin/git/grbm.js +5 -5
  76. package/bin/git/grs.js +5 -5
  77. package/bin/git/grs1.js +5 -5
  78. package/bin/git/gs.js +5 -5
  79. package/bin/git/gsh.js +5 -5
  80. package/bin/git/gshn.js +5 -5
  81. package/bin/git/gst.js +5 -5
  82. package/bin/git/gstk.js +5 -5
  83. package/bin/git/gstl.js +5 -5
  84. package/bin/git/gstp.js +5 -5
  85. package/bin/git/gsync.js +5 -5
  86. package/bin/misc/alv.js +1 -2
  87. package/bin/misc/halp.js +2 -2
  88. package/bin/misc/ll.darwin.js +5 -5
  89. package/bin/misc/ll.js +5 -5
  90. package/bin/misc/lla.darwin.js +5 -5
  91. package/bin/misc/lla.js +5 -5
  92. package/bin/misc/osv.darwin.js +5 -5
  93. package/bin/misc/osv.js +5 -5
  94. package/bin/misc/osv.win32.js +5 -5
  95. package/bin/misc/salfup.js +5 -5
  96. package/bin/node/nad.js +5 -5
  97. package/bin/node/naga.js +5 -5
  98. package/bin/node/nap.js +5 -5
  99. package/bin/node/niin.js +5 -5
  100. package/bin/node/nls.js +5 -5
  101. package/bin/node/nls1.js +5 -5
  102. package/bin/node/nlsg.js +5 -5
  103. package/bin/node/nlsg1.js +5 -5
  104. package/bin/node/nr.js +5 -5
  105. package/bin/node/nrd.js +5 -5
  106. package/bin/node/nrin.js +5 -5
  107. package/bin/node/nrp.js +5 -5
  108. package/bin/node/nrx.js +5 -5
  109. package/bin/node/ns.js +5 -5
  110. package/bin/node/nsin.js +5 -5
  111. package/bin/node/nsx.js +5 -5
  112. package/bin/node/nt.js +5 -5
  113. package/bin/node/ntin.js +5 -5
  114. package/bin/node/ntx.js +5 -5
  115. package/bin/node/nua.js +5 -5
  116. package/bin/node/nud.js +5 -5
  117. package/bin/node/nup.js +5 -5
  118. package/bin/node/nv.js +5 -5
  119. package/bin/node/nvls.js +5 -5
  120. package/bin/node/nvls.win32.js +5 -5
  121. package/bin/node/nvlsa.js +5 -5
  122. package/bin/node/nvlsa.win32.js +5 -5
  123. package/bin/node/nvmup.js +5 -5
  124. package/bin/node/nvmup.win32.js +5 -5
  125. package/bin/node/nvu.js +5 -7
  126. package/bin/node/srv.js +5 -5
  127. package/bin/node/srvw.js +5 -5
  128. package/bin/node/yad.js +5 -5
  129. package/bin/node/yaga.js +5 -5
  130. package/bin/node/yap.js +5 -5
  131. package/bin/node/yiin.js +5 -5
  132. package/bin/node/yls.js +5 -5
  133. package/bin/node/yls1.js +5 -5
  134. package/bin/node/ylsg.js +5 -5
  135. package/bin/node/ylsg1.js +5 -5
  136. package/bin/node/yr.js +5 -5
  137. package/bin/node/yrd.js +5 -5
  138. package/bin/node/yrin.js +5 -5
  139. package/bin/node/yrp.js +5 -5
  140. package/bin/node/yrx.js +5 -5
  141. package/bin/node/ys.js +5 -5
  142. package/bin/node/ysin.js +5 -5
  143. package/bin/node/ysx.js +5 -5
  144. package/bin/node/yt.js +5 -5
  145. package/bin/node/ytin.js +5 -5
  146. package/bin/node/ytx.js +5 -5
  147. package/bin/node/yua.js +5 -5
  148. package/bin/node/yud.js +5 -5
  149. package/bin/node/yup.js +5 -5
  150. package/lib/alias-scripts/a-builds-dir.js +65 -45
  151. package/lib/alias-scripts/g-pick-branch.js +44 -25
  152. package/lib/alias-scripts/g-pick-commit.js +44 -25
  153. package/lib/alias-scripts/gcoghpr.js +182 -195
  154. package/lib/alias-scripts/nvu.js +57 -49
  155. package/lib/alias.js +4 -5
  156. package/lib/constants.js +68 -47
  157. package/lib/helper.js +96 -88
  158. package/lib/utils.js +113 -58
  159. package/package.json +8 -6
  160. package/scripts/build.js +11 -10
  161. package/scripts/platformize-bin.js +7 -7
  162. package/scripts/test-pkg.js +14 -12
package/README.md CHANGED
@@ -54,7 +54,7 @@ inspecting the associated command (e.g. via `halp`).
54
54
 
55
55
  Here is the list of all global dependencies with associated min. version (older versions are not guaranteed work):
56
56
 
57
- - `git`: [git] >=2.35
57
+ - `git`: [git] >=2.40
58
58
  - `docker`: [docker] >= 17
59
59
  - `grep`: [grep] >=3 (could come through a bash emulation environment on Windows, such as [git for
60
60
  Windows][git-win]' `Git BASH`)
@@ -64,7 +64,7 @@ Here is the list of all global dependencies with associated min. version (older
64
64
  Windows][git-win]' `Git BASH`)
65
65
  - `ngm-diff-wh`: `ngm-diff-wh` >=0.0.4 (part of the [ng-maintain] suite)
66
66
  - `ngm-pr-merge`: `ngm-pr-merge` >=0.0.4 (part of the [ng-maintain] suite)
67
- - `node`: [Node.js][node] >=10
67
+ - `node`: [Node.js][node] >=16
68
68
  - `npm`: [npm] >=3 (comes bundled with Node.js)
69
69
  - `nvm`: [nvm] >=0.30 (on *nix) / [nvm-windows][nvm-win] >=1 (on Windows)
70
70
  - `yarn`: [yarn] >=0.24
@@ -100,11 +100,11 @@ Things I want to (but won't necessarily) do:
100
100
  - Add aliases for:
101
101
  - Updating to the latest Node.js version on a branch. E.g. `nvup 6` would:
102
102
  - Install the latest 6.x version.
103
- - Install packages (either via `niag` or by looking at the previously installed 6.x version).
103
+ - Install packages (either via `naga` or by looking at the previously installed 6.x version).
104
104
  - Uninstall older 6.x versions.
105
105
  - Installing the latest Node.js version on a branch. E.g. `nvi 8` would:
106
106
  - Install the latest 8.x version.
107
- - Install packages (either via `niag` or by looking at the highest installed version).
107
+ - Install packages (either via `naga` or by looking at the highest installed version).
108
108
 
109
109
 
110
110
  [build-status]: https://github.com/gkalpak/aliases/actions/workflows/ci.yml
@@ -1,11 +1,9 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- module.exports = '[PRIVATE]: Return the absolute path to \'.../angular/aio/aio-builds-setup/\'.';
4
- if (require.main === module) {
5
- const {commandUtils} = require('@gkalpak/cli-utils');
6
- const {onError} = require('../../lib/utils');
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {main} from '../../lib/alias-scripts/a-builds-dir.js';
4
+ import {isMain, onError} from '../../lib/utils.js';
5
+ export default '[PRIVATE]: Return the absolute path to \'.../angular/aio/aio-builds-setup/\'.';
6
+ if (isMain(import.meta.url)) {
7
7
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
8
-
9
- const {main} = require('../../lib/alias-scripts/a-builds-dir');
10
8
  main(args, config).catch(onError);
11
9
  }
package/bin/aio/aioall.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'aiorm && aiobd && aiord && aioatt';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'aiorm && aiobd && aiord && aioatt';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/aio/aioatt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'dkratt aio';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'dkratt aio';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/aio/aiobd.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'yarn --cwd "${0:::__a-builds-dir}/dockerbuild/scripts-js" --frozen-lockfile --non-interactive install && yarn --cwd "${0:::__a-builds-dir}/dockerbuild/scripts-js" build && dkrbd aio-builds "${0:::__a-builds-dir}/dockerbuild" $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'yarn --cwd "${0:::__a-builds-dir}/dockerbuild/scripts-js" --frozen-lockfile --non-interactive install && yarn --cwd "${0:::__a-builds-dir}/dockerbuild/scripts-js" build && dkrbd aio-builds "${0:::__a-builds-dir}/dockerbuild" $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/aio/aiord.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'dkrrd aio aio-builds --dns 127.0.0.1 -p 8000:80 -p 4430:443 $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'dkrrd aio aio-builds --dns 127.0.0.1 -p 8000:80 -p 4430:443 $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/aio/aiorm.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'dkrrm aio';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'dkrrm aio';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- const utils = require('../../lib/utils');
2
+ import {stripIndentation} from '../../lib/utils.js';
4
3
  /* eslint-disable max-len */
5
- console.log(utils.stripIndentation(`
6
- ### [Generated by: @gkalpak/aliases v0.9.4]
4
+ console.log(stripIndentation(`
5
+ ### [Generated by: @gkalpak/aliases v0.10.1]
7
6
  ### Copy the following into '~/.bashrc':
8
7
 
9
8
  # Set up prompt.
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- const utils = require('../../lib/utils');
2
+ import {stripIndentation} from '../../lib/utils.js';
4
3
  /* eslint-disable max-len */
5
- console.log(utils.stripIndentation(`
6
- ### [Generated by: @gkalpak/aliases v0.9.4]
4
+ console.log(stripIndentation(`
5
+ ### [Generated by: @gkalpak/aliases v0.10.1]
7
6
  ### Copy the following into '~/.bashrc':
8
7
 
9
8
  # Set up prompt.
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- const utils = require('../../lib/utils');
4
- console.log(utils.stripIndentation(`
5
- ### [Generated by: @gkalpak/aliases v0.9.4]
2
+ import {stripIndentation} from '../../lib/utils.js';
3
+ console.log(stripIndentation(`
4
+ ### [Generated by: @gkalpak/aliases v0.10.1]
6
5
  ### Run the following commands:
7
6
 
8
7
  git config --global commit.gpgSign true
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- const utils = require('../../lib/utils');
4
- console.log(utils.stripIndentation(`
5
- ### [Generated by: @gkalpak/aliases v0.9.4]
2
+ import {stripIndentation} from '../../lib/utils.js';
3
+ console.log(stripIndentation(`
4
+ ### [Generated by: @gkalpak/aliases v0.10.1]
6
5
  ### Run the following commands:
7
6
 
8
7
  git config --global commit.gpgSign true
9
8
  git config --global core.editor "vim"
10
- git config --global credential.helper "/mnt/c/Program\\ Files/Git/mingw64/bin/git-credential-manager-core.exe"
9
+ git config --global credential.helper "/mnt/c/Program\\ Files/Git/mingw64/bin/git-credential-manager.exe"
11
10
  git config --global merge.tool "kdiff3"
12
11
  git config --global mergetool.kdiff3.path "/path/to/kdiff3"
13
12
  git config --global mergetool.kdiff3.trustExitCode "false"
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- console.log('""" [Generated by: @gkalpak/aliases v0.9.4]');
2
+ import {readFileSync} from 'node:fs';
3
+ import {fileURLToPath} from 'node:url';
4
+ const __dirname = fileURLToPath(new URL('.', import.meta.url));
5
+ console.log('""" [Generated by: @gkalpak/aliases v0.10.1]');
4
6
  console.log('""" Copy the following into \'~/.vimrc\':\n');
5
- console.log(require('fs').readFileSync(`${__dirname}/../../lib/assets/vimrc.txt`, 'utf8').trim() + '\n');
7
+ console.log(readFileSync(`${__dirname}/../../lib/assets/vimrc.txt`, 'utf8').trim() + '\n');
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'dkrrm $1 && dkrbd $2 $3 && dkrrd $1 $2 $4* && dkratt $1';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'dkrrm $1 && dkrbd $2 $3 && dkrrd $1 $2 $4* && dkratt $1';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'docker exec -it $1 /bin/bash $2*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'docker exec -it $1 /bin/bash $2*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'docker build --tag $1 $3* $2';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'docker build --tag $1 $3* $2';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'docker run -d --name $1 -p 4000:4000 -p 4200:4200 -p 4433:4433 -p 8080:8080 -p 9876:9876 $3* $2';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'docker run -d --name $1 -p 4000:4000 -p 4200:4200 -p 4433:4433 -p 8080:8080 -p 9876:9876 $3* $2';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'docker stop $1 & docker rm $1 || true';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'docker stop $1 & docker rm $1 || true';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,11 +1,9 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- module.exports = '[PRIVATE]: Pick one from a list of branches.';
4
- if (require.main === module) {
5
- const {commandUtils} = require('@gkalpak/cli-utils');
6
- const {onError} = require('../../lib/utils');
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {main} from '../../lib/alias-scripts/g-pick-branch.js';
4
+ import {isMain, onError} from '../../lib/utils.js';
5
+ export default '[PRIVATE]: Pick one from a list of branches.';
6
+ if (isMain(import.meta.url)) {
7
7
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
8
-
9
- const {main} = require('../../lib/alias-scripts/g-pick-branch');
10
8
  main(args, config).catch(onError);
11
9
  }
@@ -1,11 +1,9 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- module.exports = '[PRIVATE]: Pick one from a list of commits.';
4
- if (require.main === module) {
5
- const {commandUtils} = require('@gkalpak/cli-utils');
6
- const {onError} = require('../../lib/utils');
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {main} from '../../lib/alias-scripts/g-pick-commit.js';
4
+ import {isMain, onError} from '../../lib/utils.js';
5
+ export default '[PRIVATE]: Pick one from a list of commits.';
6
+ if (isMain(import.meta.url)) {
7
7
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
8
-
9
- const {main} = require('../../lib/alias-scripts/g-pick-commit');
10
8
  main(args, config).catch(onError);
11
9
  }
package/bin/git/gaa.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git add --all $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git add --all $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gb.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git branch $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git branch $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gbc.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git checkout ${2:HEAD} -b $1 && git config branch.$1.remote origin && git config branch.$1.merge refs/heads/$1';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git checkout ${2:HEAD} -b $1 && git config branch.$1.remote origin && git config branch.$1.merge refs/heads/$1';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gbcm.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git checkout ${0:::(git show-ref --heads --quiet master && echo master) || (git show-ref --heads --quiet main && echo main) || echo unknown-branch} -b $1 && git config branch.$1.remote origin && git config branch.$1.merge refs/heads/$1';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git checkout ${0:::(git show-ref --heads --quiet master && echo master) || (git show-ref --heads --quiet main && echo main) || echo unknown-branch} -b $1 && git config branch.$1.remote origin && git config branch.$1.merge refs/heads/$1';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gbd.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git branch --delete --force ${*:::__g-pick-branch --gkcu-returnOutput=1}';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git branch --delete --force ${*:::__g-pick-branch --gkcu-returnOutput=1}';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcl.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git clean --interactive "${0:::git rev-parse --show-toplevel}"';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git clean --interactive "${0:::git rev-parse --show-toplevel}"';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcm.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --all $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --all $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcma.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --all --amend $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --all --amend $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmane.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --all --amend --no-edit $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --all --amend --no-edit $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmf.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --all --fixup HEAD~${1:0} $2*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --all --fixup HEAD~${1:0} $2*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmfc.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --all --fixup ${0:::__g-pick-commit --gkcu-returnOutput=1} $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --all --fixup ${0:::__g-pick-commit --gkcu-returnOutput=1} $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmfs.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --all --fixup :/$1 $2*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --all --fixup :/$1 $2*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmi.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmia.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --amend $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --amend $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --amend --no-edit $*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --amend --no-edit $*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
package/bin/git/gcmif.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
3
4
  // eslint-disable-next-line max-len
4
- const cmd = module.exports = 'git commit --fixup HEAD~${1:0} $2*';
5
- if (require.main === module) {
6
- const {commandUtils} = require('@gkalpak/cli-utils');
7
- const {onError} = require('../../lib/utils');
5
+ const cmd = 'git commit --fixup HEAD~${1:0} $2*';
6
+ export default cmd;
7
+ if (isMain(import.meta.url)) {
8
8
  const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
9
  // eslint-disable-next-line quotes
10
10
  commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);