gitsu-cli 1.0.5 → 1.0.7
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/.github/workflows/build.yml +13 -29
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/lib/package.json +11 -5
- package/lib/src/functions/save-git-config.js +3 -4
- package/package.json +1 -2
- package/src/functions/save-git-config.ts +4 -6
- package/.github/ninja.svg +0 -1
|
@@ -8,47 +8,31 @@ on:
|
|
|
8
8
|
|
|
9
9
|
permissions:
|
|
10
10
|
contents: write
|
|
11
|
-
pull-requests: read
|
|
12
|
-
statuses: write
|
|
13
11
|
|
|
14
12
|
jobs:
|
|
15
13
|
build:
|
|
16
14
|
runs-on: ubuntu-latest
|
|
17
15
|
steps:
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- name: Use Node.js 22.x
|
|
22
|
-
uses: actions/setup-node@v4
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
23
18
|
with:
|
|
24
19
|
node-version: 22
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- name: Build
|
|
30
|
-
run: npm run build
|
|
31
|
-
|
|
32
|
-
- name: Lint
|
|
33
|
-
id: lint
|
|
34
|
-
run: npm run lint
|
|
20
|
+
- run: npm ci
|
|
21
|
+
- run: npm run build
|
|
22
|
+
- run: npm run lint
|
|
35
23
|
|
|
36
24
|
release:
|
|
37
25
|
needs: [build]
|
|
38
26
|
runs-on: ubuntu-latest
|
|
27
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
39
28
|
steps:
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
run: npm run build
|
|
48
|
-
|
|
49
|
-
- name: Semantic Release
|
|
50
|
-
id: release
|
|
51
|
-
uses: cycjimmy/semantic-release-action@v4
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: 22
|
|
33
|
+
- run: npm ci
|
|
34
|
+
- run: npm run build
|
|
35
|
+
- run: npx semantic-release
|
|
52
36
|
env:
|
|
53
37
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
54
38
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.0.7](https://github.com/jamieweavis/gitsu/compare/v1.0.6...v1.0.7) (2025-04-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* handle git exec asynchronously ([cfcdb63](https://github.com/jamieweavis/gitsu/commit/cfcdb630fbd680759278f47a98f4481766d6ff0e))
|
|
7
|
+
|
|
8
|
+
## [1.0.6](https://github.com/jamieweavis/gitsu/compare/v1.0.5...v1.0.6) (2025-03-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* version number being out of sync ([62d368e](https://github.com/jamieweavis/gitsu/commit/62d368ede1b487d24a2085b4984884fdc479bcac))
|
|
14
|
+
|
|
1
15
|
## [1.0.5](https://github.com/jamieweavis/gitsu/compare/v1.0.4...v1.0.5) (2025-03-19)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/jamieweavis/gitsu/actions)
|
|
6
6
|
[](https://npmjs.com/package/gitsu-cli)
|
|
7
|
-
[](https://github.com/jamieweavis/gitsu/releases)
|
|
8
8
|
[](https://github.com/jamieweavis/gitsu/blob/main/LICENSE)
|
|
9
9
|
|
|
10
10
|
<img width=678 alt="Screenshot" src="./.github/screenshot.png">
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitsu-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Command line util for quickly & easily switching git identities",
|
|
5
5
|
"author": "Jamie Weavis",
|
|
6
6
|
"homepage": "https://github.com/jamieweavis/gitsu#readme",
|
|
@@ -60,12 +60,13 @@
|
|
|
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": [
|
|
67
|
+
"branches": [
|
|
68
|
+
"main"
|
|
69
|
+
],
|
|
69
70
|
"plugins": [
|
|
70
71
|
"@semantic-release/changelog",
|
|
71
72
|
"@semantic-release/commit-analyzer",
|
|
@@ -76,9 +77,14 @@
|
|
|
76
77
|
]
|
|
77
78
|
},
|
|
78
79
|
"lint-staged": {
|
|
79
|
-
"*.ts": [
|
|
80
|
+
"*.ts": [
|
|
81
|
+
"biome format --write",
|
|
82
|
+
"biome lint --write"
|
|
83
|
+
]
|
|
80
84
|
},
|
|
81
85
|
"commitlint": {
|
|
82
|
-
"extends": [
|
|
86
|
+
"extends": [
|
|
87
|
+
"@commitlint/config-conventional"
|
|
88
|
+
]
|
|
83
89
|
}
|
|
84
90
|
}
|
|
@@ -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
|
-
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitsu-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Command line util for quickly & easily switching git identities",
|
|
5
5
|
"author": "Jamie Weavis",
|
|
6
6
|
"homepage": "https://github.com/jamieweavis/gitsu#readme",
|
|
@@ -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
|
},
|
|
@@ -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
|
-
|
|
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>
|