@gkalpak/aliases 0.12.1 → 0.12.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.
- package/bin/config/cfgbash.js +1 -1
- package/bin/config/cfgbash.wsl.js +1 -1
- package/bin/config/cfggit.js +1 -1
- package/bin/config/cfggit.win32.js +1 -1
- package/bin/config/cfggit.wsl.js +1 -1
- package/bin/config/cfggpg.js +1 -1
- package/bin/config/cfgssh.js +1 -1
- package/bin/config/cfgvim.js +1 -1
- package/bin/config/cfgwsl.wsl.js +2 -2
- package/bin/git/gbcd.js +1 -1
- package/bin/git/gcod.js +1 -1
- package/bin/git/gprod.js +1 -1
- package/bin/git/gprud.js +1 -1
- package/bin/git/grbd.js +1 -1
- package/bin/git/gsync.js +1 -1
- package/bin/misc/alv.js +1 -1
- package/lib/constants.js +24 -25
- package/package.json +1 -1
package/bin/config/cfgbash.js
CHANGED
|
@@ -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.12.
|
|
5
|
+
### [Generated by: @gkalpak/aliases v0.12.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.12.
|
|
5
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
6
6
|
### Copy the following into '~/.bashrc':
|
|
7
7
|
|
|
8
8
|
# Set up prompt.
|
package/bin/config/cfggit.js
CHANGED
|
@@ -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.12.
|
|
4
|
+
### [Generated by: @gkalpak/aliases v0.12.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.12.
|
|
4
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
5
5
|
### Run the following commands:
|
|
6
6
|
|
|
7
7
|
git config --global commit.gpgSign true
|
package/bin/config/cfggit.wsl.js
CHANGED
|
@@ -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.12.
|
|
4
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
5
5
|
### Run the following commands:
|
|
6
6
|
|
|
7
7
|
git config --global commit.gpgSign true
|
package/bin/config/cfggpg.js
CHANGED
|
@@ -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.12.
|
|
4
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
5
5
|
### Copy the following into '~/.gnupg/gpg-agent.conf':
|
|
6
6
|
|
|
7
7
|
default-cache-ttl 86400
|
package/bin/config/cfgssh.js
CHANGED
|
@@ -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.12.
|
|
4
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
5
5
|
### Copy the following into '~/.ssh/config':
|
|
6
6
|
|
|
7
7
|
IdentityFile ~/.ssh/id-rsa-gkalpak.ppk
|
package/bin/config/cfgvim.js
CHANGED
|
@@ -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.12.
|
|
5
|
+
console.log('""" [Generated by: @gkalpak/aliases v0.12.2]');
|
|
6
6
|
console.log('""" Copy the following into \'~/.vimrc\':\n');
|
|
7
7
|
console.log(readFileSync(`${__dirname}/../../lib/assets/vimrc.txt`, 'utf8').trim() + '\n');
|
package/bin/config/cfgwsl.wsl.js
CHANGED
|
@@ -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.12.
|
|
4
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
5
5
|
### Copy the following into a root-owned, 600-mode '/etc/resolv.conf' file:
|
|
6
6
|
|
|
7
7
|
# Cloudflare
|
|
@@ -14,7 +14,7 @@ console.log(stripIndentation(`
|
|
|
14
14
|
|
|
15
15
|
-----
|
|
16
16
|
|
|
17
|
-
### [Generated by: @gkalpak/aliases v0.12.
|
|
17
|
+
### [Generated by: @gkalpak/aliases v0.12.2]
|
|
18
18
|
### Copy the following into a root-owned, 600-mode '/etc/wsl.conf' file:
|
|
19
19
|
|
|
20
20
|
[network]
|
package/bin/git/gbcd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {commandUtils} from '@gkalpak/cli-utils';
|
|
3
3
|
import {isMain, onError} from '../../lib/utils.js';
|
|
4
4
|
// eslint-disable-next-line max-len
|
|
5
|
-
const cmd = 'git checkout ${0:::
|
|
5
|
+
const cmd = 'git checkout ${0:::gdefb --gkcu-returnOutput} -b $1 && git config branch.$1.remote origin && git config branch.$1.merge refs/heads/$1';
|
|
6
6
|
export default cmd;
|
|
7
7
|
if (isMain(import.meta.url)) {
|
|
8
8
|
const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
|
package/bin/git/gcod.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {commandUtils} from '@gkalpak/cli-utils';
|
|
3
3
|
import {isMain, onError} from '../../lib/utils.js';
|
|
4
4
|
// eslint-disable-next-line max-len
|
|
5
|
-
const cmd = 'git checkout ${0:::
|
|
5
|
+
const cmd = 'git checkout ${0:::gdefb --gkcu-returnOutput} $*';
|
|
6
6
|
export default cmd;
|
|
7
7
|
if (isMain(import.meta.url)) {
|
|
8
8
|
const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
|
package/bin/git/gprod.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {commandUtils} from '@gkalpak/cli-utils';
|
|
3
3
|
import {isMain, onError} from '../../lib/utils.js';
|
|
4
4
|
// eslint-disable-next-line max-len
|
|
5
|
-
const cmd = 'git pull --rebase origin ${0:::
|
|
5
|
+
const cmd = 'git pull --rebase origin ${0:::gdefb --gkcu-returnOutput} $*';
|
|
6
6
|
export default cmd;
|
|
7
7
|
if (isMain(import.meta.url)) {
|
|
8
8
|
const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
|
package/bin/git/gprud.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {commandUtils} from '@gkalpak/cli-utils';
|
|
3
3
|
import {isMain, onError} from '../../lib/utils.js';
|
|
4
4
|
// eslint-disable-next-line max-len
|
|
5
|
-
const cmd = 'git pull --rebase upstream ${0:::
|
|
5
|
+
const cmd = 'git pull --rebase upstream ${0:::gdefb --gkcu-returnOutput} $*';
|
|
6
6
|
export default cmd;
|
|
7
7
|
if (isMain(import.meta.url)) {
|
|
8
8
|
const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
|
package/bin/git/grbd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {commandUtils} from '@gkalpak/cli-utils';
|
|
3
3
|
import {isMain, onError} from '../../lib/utils.js';
|
|
4
4
|
// eslint-disable-next-line max-len
|
|
5
|
-
const cmd = 'git rebase --ignore-date ${0:::
|
|
5
|
+
const cmd = 'git rebase --ignore-date ${0:::gdefb --gkcu-returnOutput} $*';
|
|
6
6
|
export default cmd;
|
|
7
7
|
if (isMain(import.meta.url)) {
|
|
8
8
|
const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
|
package/bin/git/gsync.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {commandUtils} from '@gkalpak/cli-utils';
|
|
3
3
|
import {isMain, onError} from '../../lib/utils.js';
|
|
4
4
|
// eslint-disable-next-line max-len
|
|
5
|
-
const cmd = 'git checkout ${1:::
|
|
5
|
+
const cmd = 'git checkout ${1:::gdefb --gkcu-returnOutput} && git pull upstream ${1:::gdefb --gkcu-returnOutput} && git push origin ${1:::gdefb --gkcu-returnOutput}';
|
|
6
6
|
export default cmd;
|
|
7
7
|
if (isMain(import.meta.url)) {
|
|
8
8
|
const {args, config} = commandUtils.preprocessArgs(process.argv.slice(2));
|
package/bin/misc/alv.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
console.log('@gkalpak/aliases v0.12.
|
|
2
|
+
console.log('@gkalpak/aliases v0.12.2');
|
package/lib/constants.js
CHANGED
|
@@ -18,21 +18,6 @@ const PR_REMOTE_ALIAS_PREFIX = 'gcoghpr';
|
|
|
18
18
|
const PR_LOCAL_BRANCH_PREFIX = 'gcoghpr';
|
|
19
19
|
|
|
20
20
|
const SOURCE_NVM_CMD = '. $NVM_DIR/nvm.sh';
|
|
21
|
-
const GIT_GET_DEFAULT_BRANCH_CMD =
|
|
22
|
-
stripIndentation(`
|
|
23
|
-
node --eval "
|
|
24
|
-
const rem = 'origin';
|
|
25
|
-
const exec = cmd => child_process.execSync(cmd, {encoding: 'utf8', stdio: 'pipe'});
|
|
26
|
-
const print = msg => process.stdout.write(msg);
|
|
27
|
-
try {
|
|
28
|
-
print(exec('git rev-parse --abbrev-ref ' + rem + '/HEAD').trim().slice(rem.length + 1));
|
|
29
|
-
} catch {
|
|
30
|
-
print(exec(['main', 'master'].
|
|
31
|
-
map(b => '(git show-ref --heads --quiet ' + b + ' && echo ' + b + ')').
|
|
32
|
-
join(' || ') +
|
|
33
|
-
' || echo unknown-branch').trim());
|
|
34
|
-
}"
|
|
35
|
-
`).replace(/([;{+])(\n)/g, '$1 $2').replace(/\n\s*/g, '');
|
|
36
21
|
const GLOBAL_NPM_PACKAGES = [
|
|
37
22
|
'@angular/cli',
|
|
38
23
|
'@gkalpak/aliases',
|
|
@@ -51,7 +36,7 @@ const GLOBAL_NPM_PACKAGES = [
|
|
|
51
36
|
|
|
52
37
|
const DESC_REPLACEMENTS = {
|
|
53
38
|
[AliasUnknown.DESCRIPTION]: '???',
|
|
54
|
-
|
|
39
|
+
'::gdefb': '<default-branch>',
|
|
55
40
|
'::__a-builds-dir': '(<.../angular/aio/aio-builds-setup>)',
|
|
56
41
|
'::__g-pick-branch --gkcu-returnOutput=1': '(interactively pick a branch)',
|
|
57
42
|
'::__g-pick-commit --gkcu-returnOutput=1': '(interactively pick a commit)',
|
|
@@ -254,7 +239,21 @@ const ALIASES = {
|
|
|
254
239
|
git: {
|
|
255
240
|
// STATUS
|
|
256
241
|
gs: new AliasDefault('git status $*'),
|
|
257
|
-
gdefb: new AliasDefault(
|
|
242
|
+
gdefb: new AliasDefault(
|
|
243
|
+
stripIndentation(`
|
|
244
|
+
node --eval "
|
|
245
|
+
const rem = 'origin';
|
|
246
|
+
const exec = cmd => child_process.execSync(cmd, {encoding: 'utf8', stdio: 'pipe'});
|
|
247
|
+
const print = msg => process.stdout.write(msg);
|
|
248
|
+
try {
|
|
249
|
+
print(exec('git rev-parse --abbrev-ref ' + rem + '/HEAD').trim().slice(rem.length + 1));
|
|
250
|
+
} catch {
|
|
251
|
+
print(exec(['main', 'master'].
|
|
252
|
+
map(b => '(git show-ref --heads --quiet ' + b + ' && echo ' + b + ')').
|
|
253
|
+
join(' || ') +
|
|
254
|
+
' || echo unknown-branch').trim());
|
|
255
|
+
}"
|
|
256
|
+
`).replace(/([;{+])(\n)/g, '$1 $2').replace(/\n\s*/g, '')),
|
|
258
257
|
gl: new AliasDefault('git log --decorate $* || true'),
|
|
259
258
|
gl1: new AliasDefault('git log --decorate --oneline $* || true'),
|
|
260
259
|
gl1g: new AliasDefault('git log --decorate --oneline | grep $*'),
|
|
@@ -276,7 +275,7 @@ const ALIASES = {
|
|
|
276
275
|
|
|
277
276
|
// CHECKOUT
|
|
278
277
|
gco: new AliasDefault('git checkout ${*:::__g-pick-branch --gkcu-returnOutput=1}'),
|
|
279
|
-
gcod: new AliasDefault(
|
|
278
|
+
gcod: new AliasDefault('git checkout ${0:::gdefb --gkcu-returnOutput} $*'),
|
|
280
279
|
gcopr: new AliasDefault('git fetch upstream pull/$1/head && git checkout FETCH_HEAD'),
|
|
281
280
|
gcoghpr: SCRIPT_BACKED_ALIAS('gcoghpr', 'Check out a GitHub pull request as a local branch.'),
|
|
282
281
|
'gcoghpr-cleanup': new AliasDefault(
|
|
@@ -312,29 +311,29 @@ const ALIASES = {
|
|
|
312
311
|
// BRANCH
|
|
313
312
|
gb: new AliasDefault('git branch $*'),
|
|
314
313
|
gbc: new AliasDefault(GIT_CREATE_BRANCH_CMD('${2:HEAD}')),
|
|
315
|
-
gbcd: new AliasDefault(GIT_CREATE_BRANCH_CMD(
|
|
314
|
+
gbcd: new AliasDefault(GIT_CREATE_BRANCH_CMD('${0:::gdefb --gkcu-returnOutput}')),
|
|
316
315
|
gbco: new AliasDefault(`git fetch origin $1 && ${GIT_CREATE_BRANCH_CMD('origin/$1')}`),
|
|
317
316
|
gbd: new AliasDefault('git branch --delete --force ${*:::__g-pick-branch --gkcu-returnOutput=1}'),
|
|
318
317
|
|
|
319
318
|
// PULL(-REBASE)
|
|
320
319
|
gpr: new AliasDefault('git pull --rebase $*'),
|
|
321
320
|
gpro: new AliasDefault('git pull --rebase origin ${*:::git rev-parse --abbrev-ref HEAD}'),
|
|
322
|
-
gprod: new AliasDefault(
|
|
321
|
+
gprod: new AliasDefault('git pull --rebase origin ${0:::gdefb --gkcu-returnOutput} $*'),
|
|
323
322
|
gpru: new AliasDefault('git pull --rebase upstream ${*:::git rev-parse --abbrev-ref HEAD}'),
|
|
324
|
-
gprud: new AliasDefault(
|
|
323
|
+
gprud: new AliasDefault('git pull --rebase upstream ${0:::gdefb --gkcu-returnOutput} $*'),
|
|
325
324
|
|
|
326
325
|
// SYNC DEFAULT BRANCH
|
|
327
326
|
gsync: new AliasDefault(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
327
|
+
'git checkout ${1:::gdefb --gkcu-returnOutput} && ' +
|
|
328
|
+
'git pull upstream ${1:::gdefb --gkcu-returnOutput} && ' +
|
|
329
|
+
'git push origin ${1:::gdefb --gkcu-returnOutput}'),
|
|
331
330
|
|
|
332
331
|
|
|
333
332
|
// REBASE
|
|
334
333
|
grb: new AliasDefault('git rebase ${*:::__g-pick-branch --gkcu-returnOutput=1}'),
|
|
335
334
|
grba: new AliasDefault('git rebase --abort'),
|
|
336
335
|
grbc: new AliasDefault('git rebase --continue'),
|
|
337
|
-
grbd: new AliasDefault(
|
|
336
|
+
grbd: new AliasDefault('git rebase --ignore-date ${0:::gdefb --gkcu-returnOutput} $*'),
|
|
338
337
|
grbi: new AliasDefault('git rebase --interactive HEAD~$1'),
|
|
339
338
|
grbia: new AliasDefault('git rebase --autosquash --interactive HEAD~$1'),
|
|
340
339
|
grbin: new AliasDefault('git rebase --no-autosquash --interactive HEAD~$1'),
|