gitsu-cli 1.0.6 → 1.0.8

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,45 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: 22.x
20
+ - run: npm clean-install
21
+ - run: npm run lint
22
+ - run: npm run build
23
+
24
+ release:
25
+ needs: build
26
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
27
+ runs-on: ubuntu-latest
28
+ permissions:
29
+ contents: write # to be able to publish a GitHub release
30
+ issues: write # to be able to comment on released issues
31
+ pull-requests: write # to be able to comment on released pull requests
32
+ id-token: write # to enable use of OIDC for npm provenance
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: actions/setup-node@v4
36
+ with:
37
+ node-version: 22.x
38
+ - run: npm clean-install
39
+ - run: npm audit signatures
40
+ - run: npm run build
41
+ - run: npx semantic-release
42
+ env:
43
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45
+ HUSKY: 0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.0.8](https://github.com/jamieweavis/gitsu/compare/v1.0.7...v1.0.8) (2025-04-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update description ([867254a](https://github.com/jamieweavis/gitsu/commit/867254a9b1dbd270eb01580796e94cc67aee2037))
7
+
8
+ ## [1.0.7](https://github.com/jamieweavis/gitsu/compare/v1.0.6...v1.0.7) (2025-04-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * handle git exec asynchronously ([cfcdb63](https://github.com/jamieweavis/gitsu/commit/cfcdb630fbd680759278f47a98f4481766d6ff0e))
14
+
1
15
  ## [1.0.6](https://github.com/jamieweavis/gitsu/compare/v1.0.5...v1.0.6) (2025-03-27)
2
16
 
3
17
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # gitsu
2
2
 
3
- > 🥷 Command line util for quickly & easily switching git identities
3
+ Interactive command line util for quickly & easily switching git users
4
4
 
5
- [![build](https://github.com/jamieweavis/gitsu/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/jamieweavis/gitsu/actions)
5
+ [![ci](https://github.com/jamieweavis/gitsu/actions/workflows/ci.yml/badge.svg)](https://github.com/jamieweavis/gitsu/actions)
6
6
  [![downloads](https://img.shields.io/npm/dt/gitsu-cli.svg)](https://npmjs.com/package/gitsu-cli)
7
7
  [![version](https://img.shields.io/npm/v/gitsu-cli.svg)](https://github.com/jamieweavis/gitsu/releases)
8
8
  [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jamieweavis/gitsu/blob/main/LICENSE)
package/lib/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gitsu-cli",
3
- "version": "1.0.5",
4
- "description": "Command line util for quickly & easily switching git identities",
3
+ "version": "1.0.7",
4
+ "description": "Interactive command line util for quickly & easily switching git users",
5
5
  "author": "Jamie Weavis",
6
6
  "homepage": "https://github.com/jamieweavis/gitsu#readme",
7
7
  "license": "MIT",
@@ -60,14 +60,11 @@
60
60
  "cz-conventional-changelog": "^3.3.0",
61
61
  "husky": "^9.1.7",
62
62
  "lint-staged": "^15.5.0",
63
- "semantic-release": "^24.2.3",
64
63
  "ts-node": "^10.9.2",
65
64
  "ts-node-dev": "^2.0.0"
66
65
  },
67
66
  "release": {
68
- "branches": [
69
- "main"
70
- ],
67
+ "branches": ["main"],
71
68
  "plugins": [
72
69
  "@semantic-release/changelog",
73
70
  "@semantic-release/commit-analyzer",
@@ -78,14 +75,9 @@
78
75
  ]
79
76
  },
80
77
  "lint-staged": {
81
- "*.ts": [
82
- "biome format --write",
83
- "biome lint --write"
84
- ]
78
+ "*.ts": ["biome format --write", "biome lint --write"]
85
79
  },
86
80
  "commitlint": {
87
- "extends": [
88
- "@commitlint/config-conventional"
89
- ]
81
+ "extends": ["@commitlint/config-conventional"]
90
82
  }
91
83
  }
package/lib/src/app.js CHANGED
@@ -10,7 +10,7 @@ const edit_1 = __importDefault(require("./commands/edit"));
10
10
  const init_1 = __importDefault(require("./commands/init"));
11
11
  const list_1 = __importDefault(require("./commands/list"));
12
12
  const bootstrap = () => {
13
- commander_1.program.description('Command line util for quickly & easily switching git identities');
13
+ commander_1.program.description(package_json_1.description);
14
14
  commander_1.program.version(package_json_1.version);
15
15
  commander_1.program.option('-e, --edit', 'edit ~/.gitsurc with your EDITOR');
16
16
  commander_1.program.option('-l, --list', 'list users stored in ~/.gitsurc');
@@ -13,13 +13,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const node_child_process_1 = require("node:child_process");
16
+ const node_util_1 = require("node:util");
16
17
  const log_symbols_1 = __importDefault(require("log-symbols"));
18
+ const execPromise = (0, node_util_1.promisify)(node_child_process_1.exec);
17
19
  exports.default = (user) => __awaiter(void 0, void 0, void 0, function* () {
18
20
  try {
19
- // If user is in a git repo, save user to local git config
20
- yield (0, node_child_process_1.exec)(`cd ${process.cwd()} && git config user.name "${user.name}" && git config user.email "${user.email}"`);
21
- // Save user to global git config
22
- yield (0, node_child_process_1.exec)(`git config --global user.name "${user.name}" && git config --global user.email "${user.email}"`);
21
+ yield execPromise(`git config --global user.name "${user.name}" && git config --global user.email "${user.email}"`);
23
22
  return true;
24
23
  }
25
24
  catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gitsu-cli",
3
- "version": "1.0.6",
4
- "description": "Command line util for quickly & easily switching git identities",
3
+ "version": "1.0.8",
4
+ "description": "Interactive command line util for quickly & easily switching git users",
5
5
  "author": "Jamie Weavis",
6
6
  "homepage": "https://github.com/jamieweavis/gitsu#readme",
7
7
  "license": "MIT",
@@ -60,7 +60,6 @@
60
60
  "cz-conventional-changelog": "^3.3.0",
61
61
  "husky": "^9.1.7",
62
62
  "lint-staged": "^15.5.0",
63
- "semantic-release": "^24.2.3",
64
63
  "ts-node": "^10.9.2",
65
64
  "ts-node-dev": "^2.0.0"
66
65
  },
package/src/app.ts CHANGED
@@ -2,15 +2,13 @@
2
2
 
3
3
  import { program } from 'commander';
4
4
 
5
- import { version } from '../package.json';
5
+ import { description, version } from '../package.json';
6
6
  import edit from './commands/edit';
7
7
  import init from './commands/init';
8
8
  import list from './commands/list';
9
9
 
10
10
  const bootstrap = () => {
11
- program.description(
12
- 'Command line util for quickly & easily switching git identities',
13
- );
11
+ program.description(description);
14
12
  program.version(version);
15
13
  program.option('-e, --edit', 'edit ~/.gitsurc with your EDITOR');
16
14
  program.option('-l, --list', 'list users stored in ~/.gitsurc');
@@ -1,16 +1,14 @@
1
1
  import { exec } from 'node:child_process';
2
+ import { promisify } from 'node:util';
2
3
  import logSymbols from 'log-symbols';
3
4
 
5
+ const execPromise = promisify(exec);
6
+
4
7
  import type { IUser } from '../types';
5
8
 
6
9
  export default async (user: IUser): Promise<boolean> => {
7
10
  try {
8
- // If user is in a git repo, save user to local git config
9
- await exec(
10
- `cd ${process.cwd()} && git config user.name "${user.name}" && git config user.email "${user.email}"`,
11
- );
12
- // Save user to global git config
13
- await exec(
11
+ await execPromise(
14
12
  `git config --global user.name "${user.name}" && git config --global user.email "${user.email}"`,
15
13
  );
16
14
  return true;
package/.github/ninja.svg DELETED
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg"><path d="m1.072 17.668 2.048-1.434 6.31 9.011-2.048 1.434z" fill="#42484c"/><path d="m3.897 16.909-2.457 1.721c-.225.158-.539.102-.696-.123-.158-.225-.102-.539.123-.696l2.457-1.721c.225-.158.539-.102.696.123.158.225.103.538-.123.696zm6.555 7.618-4.096 2.868c-.225.158-.539.102-.696-.123-.158-.225-.102-.539.123-.696l4.096-2.868c.225-.158.539-.102.696.123.158.225.102.538-.123.696z" fill="#66757f"/><path d="m6.971 26.966 2.868-2.008 5.161 7.373-2.867 2.008zm-4.752-7.66 2.048-1.434.573.82-2.048 1.433zm1.147 1.638 2.048-1.434.573.82-2.048 1.434zm1.147 1.639 2.048-1.434.574.82-2.048 1.434zm1.147 1.639 2.048-1.434.574.819-2.048 1.434z"/><path d="m23.35 20.14s3.921 3.102 2.223 6.86c.001 0-4.541-2.318-2.223-6.86z" fill="#292f33"/><path d="m25.967 25.593c.191-1.638-.552-3.065-1.296-4.05-.765-.365-1.418-.543-1.667-.602-.04.111-.061.215-.093.324.139 2.639 1.694 3.814 3.056 4.328z"/><g fill="#292f33"><path d="m23 20s4.905.968 5.112 5.086c0 0-5.099.013-5.112-5.086zm9 16v-2c0-3.314-2.685-6-6-6h-16c-3.313 0-6 2.686-6 6v2z"/><path d="m12.799 26.751h10.403v4.249h-10.403z"/><path d="m14 27h8s-1.018 7-4 7-4-7-4-7"/><path d="m13.64 30.038c1.744 1.268 2.848 1.963 4.36 1.963s2.615-.696 4.359-1.963v-5.749h-8.72v5.749z"/></g><path d="m13.632 25.973c1.216 1.374 2.724 1.746 4.364 1.746 1.639 0 3.146-.373 4.363-1.746v-3.491h-8.728v3.491z"/><path d="m11.444 15.936c0 1.448-.734 2.622-1.639 2.622s-1.639-1.174-1.639-2.622.734-2.623 1.639-2.623c.905-.001 1.639 1.174 1.639 2.623m16.389 0c0 1.448-.733 2.622-1.639 2.622-.905 0-1.639-1.174-1.639-2.622s.733-2.623 1.639-2.623c.906-.001 1.639 1.174 1.639 2.623" fill="#292f33"/><path d="m9.477 16.54c0-7.54 2.523-11.54 8.523-11.54s8.522 4 8.522 11.54c0 5.821-3.815 10.54-8.522 10.54s-8.523-4.719-8.523-10.54" fill="#292f33"/><path d="m11 28c0 1 1 3 3 5 1.581 1.581 2.719 3 2.719 3 .797-.005 1.9-.004 2.73-.001-.891-2.02-2.477-3.471-3.279-4.273-1-1-3.17-2.726-3.17-4.726 0-1-2 1-2 1" fill="#66757f"/><path d="m16.719 36 2.724-.001c-.512-1.161-1.251-2.127-1.94-2.897-.505.613-.992 1.346-1.405 2.16.388.449.621.738.621.738z" fill="#292f33"/><path d="m25 28c0 1-1 3-3 5-1.581 1.581-2.5 3-2.5 3-.902-.004-1.418-.002-3 0 .891-2.02 2.528-3.472 3.33-4.274 1-1 3.17-2.726 3.17-4.726 0-1 2 1 2 1" fill="#66757f"/><path d="m18 13.711c-2.995 0-8.116-2.044-7.064 1.98.614 2.348 1.417 2.881 3.475 2.606 2.124-.283 1.991-1.016 3.495-1.016s1.56.733 3.684 1.016c2.058.274 2.861-.258 3.475-2.606 1.051-4.024-4.07-1.98-7.065-1.98z" fill="#ffdc5d"/><path d="m14 17c-.55 0-1-.45-1-1v-1c0-.55.45-1 1-1s1 .45 1 1v1c0 .55-.45 1-1 1m8 0c-.55 0-1-.45-1-1v-1c0-.55.45-1 1-1s1 .45 1 1v1c0 .55-.45 1-1 1" fill="#662113"/></svg>
@@ -1,58 +0,0 @@
1
- name: build
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- branches: [main]
8
-
9
- permissions:
10
- contents: write
11
- pull-requests: read
12
- statuses: write
13
-
14
- jobs:
15
- build:
16
- runs-on: ubuntu-latest
17
- steps:
18
- - name: Checkout
19
- uses: actions/checkout@v4
20
-
21
- - name: Use Node.js 22.x
22
- uses: actions/setup-node@v4
23
- with:
24
- node-version: 22
25
-
26
- - name: Install Dependencies
27
- run: npm install
28
-
29
- - name: Build
30
- run: npm run build
31
-
32
- - name: Lint
33
- id: lint
34
- run: npm run lint
35
-
36
- release:
37
- needs: [build]
38
- runs-on: ubuntu-latest
39
- steps:
40
- - name: Checkout
41
- uses: actions/checkout@v4
42
- with:
43
- fetch-depth: 0
44
- persist-credentials: false
45
-
46
- - name: Install Dependencies
47
- run: npm install
48
-
49
- - name: Build
50
- run: npm run build
51
-
52
- - name: Semantic Release
53
- id: release
54
- uses: cycjimmy/semantic-release-action@v4
55
- env:
56
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58
- HUSKY: 0
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v22