@gkalpak/aliases 0.10.1 → 0.10.2

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.
@@ -2,7 +2,7 @@
2
2
  import {stripIndentation} from '../../lib/utils.js';
3
3
  /* eslint-disable max-len */
4
4
  console.log(stripIndentation(`
5
- ### [Generated by: @gkalpak/aliases v0.10.1]
5
+ ### [Generated by: @gkalpak/aliases v0.10.2]
6
6
  ### Copy the following into '~/.bashrc':
7
7
 
8
8
  # Set up prompt.
@@ -2,7 +2,7 @@
2
2
  import {stripIndentation} from '../../lib/utils.js';
3
3
  /* eslint-disable max-len */
4
4
  console.log(stripIndentation(`
5
- ### [Generated by: @gkalpak/aliases v0.10.1]
5
+ ### [Generated by: @gkalpak/aliases v0.10.2]
6
6
  ### Copy the following into '~/.bashrc':
7
7
 
8
8
  # Set up prompt.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {stripIndentation} from '../../lib/utils.js';
3
3
  console.log(stripIndentation(`
4
- ### [Generated by: @gkalpak/aliases v0.10.1]
4
+ ### [Generated by: @gkalpak/aliases v0.10.2]
5
5
  ### Run the following commands:
6
6
 
7
7
  git config --global commit.gpgSign true
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {stripIndentation} from '../../lib/utils.js';
3
3
  console.log(stripIndentation(`
4
- ### [Generated by: @gkalpak/aliases v0.10.1]
4
+ ### [Generated by: @gkalpak/aliases v0.10.2]
5
5
  ### Run the following commands:
6
6
 
7
7
  git config --global commit.gpgSign true
@@ -2,6 +2,6 @@
2
2
  import {readFileSync} from 'node:fs';
3
3
  import {fileURLToPath} from 'node:url';
4
4
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
5
- console.log('""" [Generated by: @gkalpak/aliases v0.10.1]');
5
+ console.log('""" [Generated by: @gkalpak/aliases v0.10.2]');
6
6
  console.log('""" Copy the following into \'~/.vimrc\':\n');
7
7
  console.log(readFileSync(`${__dirname}/../../lib/assets/vimrc.txt`, 'utf8').trim() + '\n');
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import {commandUtils} from '@gkalpak/cli-utils';
3
+ import {isMain, onError} from '../../lib/utils.js';
4
+ // eslint-disable-next-line max-len
5
+ const cmd = 'git fetch origin $1 && git checkout origin/$1 -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
+ const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
9
+ // eslint-disable-next-line quotes
10
+ commandUtils.run(cmd, args, Object.assign({"sapVersion":2}, config)).catch(onError);
11
+ }
package/bin/misc/alv.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- console.log('@gkalpak/aliases v0.10.1');
2
+ console.log('@gkalpak/aliases v0.10.2');
package/lib/constants.js CHANGED
@@ -115,6 +115,10 @@ const CFGGIT_SPEC_WITH_CRED_HELPER = credHelper => new AliasSpec(
115
115
  `),
116
116
  'Show configuration instructions for `git`.');
117
117
 
118
+ const GIT_CREATE_BRANCH_CMD = srcBranchArg =>
119
+ `git checkout ${srcBranchArg} -b $1 && git config branch.$1.remote origin && ` +
120
+ 'git config branch.$1.merge refs/heads/$1';
121
+
118
122
  const SCRIPT_BACKED_CODE = (scriptName, desc) => stripIndentation(`
119
123
  #!/usr/bin/env node
120
124
  import {commandUtils} from '@gkalpak/cli-utils';
@@ -262,12 +266,9 @@ const ALIASES = {
262
266
 
263
267
  // BRANCH
264
268
  gb: new AliasDefault('git branch $*'),
265
- gbc: new AliasDefault(
266
- 'git checkout ${2:HEAD} -b $1 && git config branch.$1.remote origin && ' +
267
- 'git config branch.$1.merge refs/heads/$1'),
268
- gbcm: new AliasDefault(
269
- `git checkout \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} -b $1 && git config branch.$1.remote origin && ` +
270
- 'git config branch.$1.merge refs/heads/$1'),
269
+ gbc: new AliasDefault(GIT_CREATE_BRANCH_CMD('${2:HEAD}')),
270
+ gbcm: new AliasDefault(GIT_CREATE_BRANCH_CMD(`\${0:::${GIT_GET_DEFAULT_BRANCH_CMD}}`)),
271
+ gbco: new AliasDefault(`git fetch origin $1 && ${GIT_CREATE_BRANCH_CMD('origin/$1')}`),
271
272
  gbd: new AliasDefault('git branch --delete --force ${*:::__g-pick-branch --gkcu-returnOutput=1}'),
272
273
 
273
274
  // PULL(-REBASE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gkalpak/aliases",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "My global aliases.",
5
5
  "keywords": [
6
6
  "Utility"
@@ -52,6 +52,7 @@
52
52
  "gb": "./bin/git/gb.js",
53
53
  "gbc": "./bin/git/gbc.js",
54
54
  "gbcm": "./bin/git/gbcm.js",
55
+ "gbco": "./bin/git/gbco.js",
55
56
  "gbd": "./bin/git/gbd.js",
56
57
  "gcl": "./bin/git/gcl.js",
57
58
  "gcm": "./bin/git/gcm.js",