mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-03 02:21:44 +00:00
style(ci-setup): apply prettier formatting to prompts.ts and ci-setup.test.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8bc4ce1859
commit
03b47a82f7
2 changed files with 14 additions and 7 deletions
|
|
@ -1,5 +1,12 @@
|
|||
import { select } from '@inquirer/prompts';
|
||||
import type { CiSetupOptions, CiSystem, DeployTarget, AuthMode, BranchStrategy, DetectResult } from './types.js';
|
||||
import type {
|
||||
CiSetupOptions,
|
||||
CiSystem,
|
||||
DeployTarget,
|
||||
AuthMode,
|
||||
BranchStrategy,
|
||||
DetectResult,
|
||||
} from './types.js';
|
||||
|
||||
export async function resolveOptions(
|
||||
detect: DetectResult,
|
||||
|
|
@ -24,7 +31,7 @@ export async function resolveOptions(
|
|||
dryRun: partial.dryRun ?? false,
|
||||
apply: partial.apply ?? false,
|
||||
yes: partial.yes ?? false,
|
||||
outputDir: partial.outputDir ?? (detect.gitRoot ?? process.cwd()),
|
||||
outputDir: partial.outputDir ?? detect.gitRoot ?? process.cwd(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ vi.mock('@inquirer/prompts', () => ({
|
|||
vi.mock('child_process', () => ({
|
||||
execSync: vi.fn((cmd: string) => {
|
||||
const gitRoot = process.env._TEST_GIT_ROOT;
|
||||
if (cmd.includes('rev-parse --show-toplevel') || cmd.includes('rev-parse --is-inside-work-tree')) {
|
||||
if (
|
||||
cmd.includes('rev-parse --show-toplevel') ||
|
||||
cmd.includes('rev-parse --is-inside-work-tree')
|
||||
) {
|
||||
if (!gitRoot) throw new Error('not a git repository');
|
||||
return Buffer.from(gitRoot);
|
||||
}
|
||||
|
|
@ -166,10 +169,7 @@ describe('ciSetupCommand', () => {
|
|||
outputDir: tempDir,
|
||||
});
|
||||
|
||||
const dcContent = await fs.readFile(
|
||||
path.join(tempDir, 'docker-compose.gitnexus.yml'),
|
||||
'utf-8',
|
||||
);
|
||||
const dcContent = await fs.readFile(path.join(tempDir, 'docker-compose.gitnexus.yml'), 'utf-8');
|
||||
expect(dcContent).not.toContain('gitnexus-proxy');
|
||||
expect(dcContent).not.toContain('caddy');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue