gh-setup-git-identity 0.4.0 → 0.4.1
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/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/cli.js +1 -11
- package/src/index.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# gh-setup-git-identity
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 43e1c63: Reduce excessive blank lines in console output
|
|
8
|
+
|
|
9
|
+
- Removed unnecessary blank lines in CLI output to make it more concise
|
|
10
|
+
- Improved readability by minimizing spacing while maintaining logical separation
|
|
11
|
+
- Fixed issue where authentication and configuration messages had too much whitespace
|
|
12
|
+
|
|
3
13
|
## 0.4.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -66,9 +66,7 @@ async function main() {
|
|
|
66
66
|
const authenticated = await isGhAuthenticated({ verbose: config.verbose });
|
|
67
67
|
|
|
68
68
|
if (!authenticated) {
|
|
69
|
-
console.log('');
|
|
70
69
|
console.log('GitHub CLI is not authenticated. Starting authentication...');
|
|
71
|
-
console.log('');
|
|
72
70
|
|
|
73
71
|
// Automatically run gh auth login
|
|
74
72
|
const loginSuccess = await runGhAuthLogin({ verbose: config.verbose });
|
|
@@ -76,13 +74,9 @@ async function main() {
|
|
|
76
74
|
if (!loginSuccess) {
|
|
77
75
|
console.log('');
|
|
78
76
|
console.log('Authentication failed. Please try running manually:');
|
|
79
|
-
console.log('');
|
|
80
77
|
console.log(' printf "y" | gh auth login -h github.com -s repo,workflow,user,read:org,gist --git-protocol https --web');
|
|
81
|
-
console.log('');
|
|
82
78
|
process.exit(1);
|
|
83
79
|
}
|
|
84
|
-
|
|
85
|
-
console.log('');
|
|
86
80
|
}
|
|
87
81
|
|
|
88
82
|
// Prepare options
|
|
@@ -94,12 +88,11 @@ async function main() {
|
|
|
94
88
|
|
|
95
89
|
if (options.verbose) {
|
|
96
90
|
console.log('Options:', options);
|
|
97
|
-
console.log('');
|
|
98
91
|
}
|
|
99
92
|
|
|
100
93
|
if (options.dryRun) {
|
|
101
|
-
console.log('DRY MODE - No actual changes will be made');
|
|
102
94
|
console.log('');
|
|
95
|
+
console.log('DRY MODE - No actual changes will be made');
|
|
103
96
|
}
|
|
104
97
|
|
|
105
98
|
// Setup git identity
|
|
@@ -108,10 +101,8 @@ async function main() {
|
|
|
108
101
|
// Display results
|
|
109
102
|
console.log('');
|
|
110
103
|
console.log(`${options.dryRun ? '[DRY MODE] Would configure' : 'Git configured'}:`);
|
|
111
|
-
console.log('');
|
|
112
104
|
console.log(` user.name: ${result.username}`);
|
|
113
105
|
console.log(` user.email: ${result.email}`);
|
|
114
|
-
console.log('');
|
|
115
106
|
console.log(`Scope: ${scope === 'global' ? 'global (--global)' : 'local (--local)'}`);
|
|
116
107
|
console.log('');
|
|
117
108
|
|
|
@@ -125,7 +116,6 @@ async function main() {
|
|
|
125
116
|
console.error('Error:', error.message);
|
|
126
117
|
|
|
127
118
|
if (config.verbose) {
|
|
128
|
-
console.error('');
|
|
129
119
|
console.error('Stack trace:');
|
|
130
120
|
console.error(error.stack);
|
|
131
121
|
}
|
package/src/index.js
CHANGED
|
@@ -126,9 +126,6 @@ export async function runGhAuthLogin(options = {}) {
|
|
|
126
126
|
const { verbose = false, logger = console } = options;
|
|
127
127
|
const log = createDefaultLogger({ verbose, logger });
|
|
128
128
|
|
|
129
|
-
log(() => 'Starting GitHub CLI authentication...');
|
|
130
|
-
log(() => '');
|
|
131
|
-
|
|
132
129
|
// Run gh auth login with the required scopes
|
|
133
130
|
// Use 'y' as input to confirm default account selection
|
|
134
131
|
const result = await execInteractiveCommand('gh', [
|
|
@@ -144,7 +141,6 @@ export async function runGhAuthLogin(options = {}) {
|
|
|
144
141
|
return false;
|
|
145
142
|
}
|
|
146
143
|
|
|
147
|
-
log(() => '');
|
|
148
144
|
log(() => 'GitHub CLI authentication successful!');
|
|
149
145
|
return true;
|
|
150
146
|
}
|
|
@@ -336,7 +332,6 @@ export async function setupGitIdentity(options = {}) {
|
|
|
336
332
|
log(() => `GitHub email: ${email}`);
|
|
337
333
|
|
|
338
334
|
if (dryRun) {
|
|
339
|
-
log(() => '');
|
|
340
335
|
log(() => 'DRY MODE: Would configure the following:');
|
|
341
336
|
log(() => ` git config --${scope} user.name "${username}"`);
|
|
342
337
|
log(() => ` git config --${scope} user.email "${email}"`);
|
|
@@ -344,7 +339,6 @@ export async function setupGitIdentity(options = {}) {
|
|
|
344
339
|
}
|
|
345
340
|
|
|
346
341
|
// Set git config
|
|
347
|
-
log(() => '');
|
|
348
342
|
log(() => `Configuring git (${scope})...`);
|
|
349
343
|
|
|
350
344
|
await setGitConfig('user.name', username, { scope, verbose, logger });
|