gitsu-cli 1.0.1 → 1.0.4

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.
Binary file
@@ -8,6 +8,8 @@ on:
8
8
 
9
9
  permissions:
10
10
  contents: write
11
+ pull-requests: read
12
+ statuses: write
11
13
 
12
14
  jobs:
13
15
  build:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [1.0.4](https://github.com/jamieweavis/gitsu/compare/v1.0.3...v1.0.4) (2025-03-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * save local and global git configs ([37c6b96](https://github.com/jamieweavis/gitsu/commit/37c6b960dddc41c180c6f99ec0a3c6e9bfd600fe))
7
+
8
+ ## [1.0.3](https://github.com/jamieweavis/gitsu/compare/v1.0.2...v1.0.3) (2025-03-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * npm publish ([0f76e46](https://github.com/jamieweavis/gitsu/commit/0f76e463d8208811b07430a7a499988e67ca6e68))
14
+
15
+ ## [1.0.2](https://github.com/jamieweavis/gitsu/compare/v1.0.1...v1.0.2) (2025-03-16)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * save git config globally ([d744f2f](https://github.com/jamieweavis/gitsu/commit/d744f2ff3c39187531c60d41df3269b8f4bd7d7e))
21
+
1
22
  ## [1.0.1](https://github.com/jamieweavis/gitsu/compare/v1.0.0...v1.0.1) (2025-03-15)
2
23
 
3
24
 
package/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
  [![version](https://img.shields.io/github/release/jamieweavis/gitsu.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)
9
9
 
10
+ <img width=678 alt="Screenshot" src="./.github/screenshot.png">
11
+
10
12
  ## Install
11
13
 
12
14
  ```sh
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitsu-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Command line util for quickly & easily switching git users",
5
5
  "author": "Jamie Weavis",
6
6
  "homepage": "https://github.com/jamieweavis/gitsu#readme",
@@ -65,7 +65,9 @@
65
65
  "ts-node-dev": "^2.0.0"
66
66
  },
67
67
  "release": {
68
- "branches": ["main"],
68
+ "branches": [
69
+ "main"
70
+ ],
69
71
  "plugins": [
70
72
  "@semantic-release/changelog",
71
73
  "@semantic-release/commit-analyzer",
@@ -76,9 +78,14 @@
76
78
  ]
77
79
  },
78
80
  "lint-staged": {
79
- "*.ts": ["biome format --write", "biome lint --write"]
81
+ "*.ts": [
82
+ "biome format --write",
83
+ "biome lint --write"
84
+ ]
80
85
  },
81
86
  "commitlint": {
82
- "extends": ["@commitlint/config-conventional"]
87
+ "extends": [
88
+ "@commitlint/config-conventional"
89
+ ]
83
90
  }
84
91
  }
@@ -12,11 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const node_child_process_1 = __importDefault(require("node:child_process"));
15
+ const node_child_process_1 = require("node:child_process");
16
16
  const log_symbols_1 = __importDefault(require("log-symbols"));
17
17
  exports.default = (user) => __awaiter(void 0, void 0, void 0, function* () {
18
18
  try {
19
- yield node_child_process_1.default.exec(`git config user.name "${user.name}" && git config user.email "${user.email}"`);
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}"`);
20
23
  return true;
21
24
  }
22
25
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitsu-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "Command line util for quickly & easily switching git users",
5
5
  "author": "Jamie Weavis",
6
6
  "homepage": "https://github.com/jamieweavis/gitsu#readme",
@@ -1,14 +1,18 @@
1
- import child_process from 'node:child_process';
1
+ import { exec } from 'node:child_process';
2
2
  import logSymbols from 'log-symbols';
3
3
 
4
4
  import type { IUser } from '../types';
5
5
 
6
6
  export default async (user: IUser): Promise<boolean> => {
7
7
  try {
8
- await child_process.exec(
9
- `git config user.name "${user.name}" && git config user.email "${user.email}"`,
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(
14
+ `git config --global user.name "${user.name}" && git config --global user.email "${user.email}"`,
10
15
  );
11
-
12
16
  return true;
13
17
  } catch (error) {
14
18
  console.error(`${logSymbols.error} Failed to save git config`, error);