octo-dev 0.5.2 → 0.5.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.
- package/package.json +1 -1
- package/src/cli/config.command.ts +17 -0
- package/src/cli/index.ts +13 -1
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { run } from '../shared/process-runner.js';
|
|
2
|
+
import { logger } from '../shared/logger.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* octo config git-cache
|
|
6
|
+
*
|
|
7
|
+
* Enables git credential cache locally.
|
|
8
|
+
*/
|
|
9
|
+
export async function configGitCacheCommand(value?: string): Promise<void> {
|
|
10
|
+
const helper = value || 'cache';
|
|
11
|
+
const result = await run('git', ['config', '--local', 'credential.helper', helper]);
|
|
12
|
+
if (result.exitCode !== 0) {
|
|
13
|
+
logger.error(`Failed to set credential.helper: ${result.stderr.trim()}`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
logger.info(`Git credential.helper set to "${helper}".`);
|
|
17
|
+
}
|
package/src/cli/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ const program = new Command();
|
|
|
11
11
|
program
|
|
12
12
|
.name('octo')
|
|
13
13
|
.description('Monorepo build orchestration, versioning, and infrastructure CLI')
|
|
14
|
-
.version('0.5.
|
|
14
|
+
.version('0.5.4');
|
|
15
15
|
|
|
16
16
|
program
|
|
17
17
|
.command('init')
|
|
@@ -86,4 +86,16 @@ program
|
|
|
86
86
|
await addCommand(repoUrl, opts);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
+
const config = program
|
|
90
|
+
.command('config')
|
|
91
|
+
.description('Configure octo and git settings');
|
|
92
|
+
|
|
93
|
+
config
|
|
94
|
+
.command('git-cache [value]')
|
|
95
|
+
.description('Set git credential.helper (default: "cache")')
|
|
96
|
+
.action(async (value) => {
|
|
97
|
+
const { configGitCacheCommand } = await import('./config.command.js');
|
|
98
|
+
await configGitCacheCommand(value);
|
|
99
|
+
});
|
|
100
|
+
|
|
89
101
|
program.parse();
|