avil13-co 2.2.0 → 2.2.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.
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "avil13-co",
3
+ "version": "2.2.2",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "public": true,
7
+ "bin": {
8
+ "co": "./bin/co"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "bin",
13
+ "src",
14
+ "assets"
15
+ ],
16
+ "scripts": {
17
+ "prepublishOnly": "npm run build",
18
+ "start": "npm run build && node dist/index.js",
19
+ "dev": "ts-node --project tsconfig.json src/index.ts",
20
+ "dev:watch": "nodemon",
21
+ "lint:fix": "eslint --fix --ext .js,.ts .",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest",
24
+ "type-check": "tsc -p . --noEmit",
25
+ "type-check:watch": "npm run type-check -- --watch",
26
+ "build": "rm -rf ./dist && tsc -p ."
27
+ },
28
+ "keywords": [
29
+ "git",
30
+ "git checkout",
31
+ "cli"
32
+ ],
33
+ "author": "Aleksey Pivkin",
34
+ "license": "ISC",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git@github.com:avil13/avil13-git-co.git"
38
+ },
39
+ "dependencies": {
40
+ "inquirer": "^8.2.2",
41
+ "inquirer-autocomplete-prompt": "^2.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@types/inquirer": "^8.2.1",
45
+ "@types/node": "^17.0.23",
46
+ "ts-node": "^10.7.0",
47
+ "typescript": "^4.6.3",
48
+ "vitest": "^0.10.0"
49
+ }
50
+ }
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getHelp = exports.getWishOfUser = exports.Commands = void 0;
4
+ const package_json_1 = require("../../package.json");
4
5
  const args = process.argv.slice(2);
5
6
  var Commands;
6
7
  (function (Commands) {
@@ -34,6 +35,7 @@ const getHelp = () => {
34
35
  return `
35
36
  DESCRIPTION:
36
37
  A console program for quickly switching between branches
38
+ VERSION: ${package_json_1.version}
37
39
 
38
40
  OPTIONS:
39
41
  help, -h, --h, --help
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,6 +4,7 @@ const ask_1 = require("./ask");
4
4
  const cli_commands_1 = require("./cli-commands");
5
5
  const commands_1 = require("./commands");
6
6
  const delete_barnch_1 = require("./commands/delete-barnch");
7
+ const merge_branch_1 = require("./commands/merge-branch");
7
8
  const run = async () => {
8
9
  const userWish = (0, cli_commands_1.getWishOfUser)();
9
10
  if (cli_commands_1.Commands.Help === userWish) {
@@ -23,6 +24,10 @@ const run = async () => {
23
24
  (0, delete_barnch_1.deleteBranch)(branch);
24
25
  return;
25
26
  }
27
+ if (cli_commands_1.Commands.MergeBranch === userWish) {
28
+ (0, merge_branch_1.mergeBranch)(branch);
29
+ return;
30
+ }
26
31
  await (0, commands_1.checkoutBranch)(branch);
27
32
  await (0, commands_1.getCurrentBranchName)();
28
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avil13-co",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "public": true,
@@ -1,4 +1,5 @@
1
1
  import { clc } from '../color';
2
+ import { version } from '../../package.json';
2
3
 
3
4
  const args = process.argv.slice(2);
4
5
 
@@ -40,6 +41,7 @@ export const getHelp = (): string => {
40
41
  return `
41
42
  DESCRIPTION:
42
43
  A console program for quickly switching between branches
44
+ VERSION: ${version}
43
45
 
44
46
  OPTIONS:
45
47
  help, -h, --h, --help
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ import { ask } from './ask';
2
2
  import { Commands, getHelp, getWishOfUser } from './cli-commands';
3
3
  import { BranchesType, checkoutBranch, getBranches, getCurrentBranchName } from './commands';
4
4
  import { deleteBranch } from './commands/delete-barnch';
5
+ import { mergeBranch } from './commands/merge-branch';
5
6
 
6
7
  const run = async () => {
7
8
  const userWish = getWishOfUser();
@@ -28,6 +29,11 @@ const run = async () => {
28
29
  return;
29
30
  }
30
31
 
32
+ if (Commands.MergeBranch === userWish) {
33
+ mergeBranch(branch);
34
+ return;
35
+ }
36
+
31
37
  await checkoutBranch(branch);
32
38
 
33
39
  await getCurrentBranchName()