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
|
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
|
[](https://github.com/jamieweavis/gitsu/releases)
|
|
8
8
|
[](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.
|
|
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": [
|
|
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": [
|
|
81
|
+
"*.ts": [
|
|
82
|
+
"biome format --write",
|
|
83
|
+
"biome lint --write"
|
|
84
|
+
]
|
|
80
85
|
},
|
|
81
86
|
"commitlint": {
|
|
82
|
-
"extends": [
|
|
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 =
|
|
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
|
-
|
|
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,14 +1,18 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
9
|
-
|
|
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);
|