Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/rstack/src/setup/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseArgs } from 'node:util';
import { color } from 'rslog';
import { color, logger } from 'rslog';
import { installHooks } from './install.ts';

const helpMessage = `Rstack v${RSTACK_VERSION}
Expand Down Expand Up @@ -45,7 +45,7 @@ export const runSetupCLI = (args: string[]): void => {
if (result.status === 'skipped') {
const reason =
result.reason === 'disabled' ? 'disabled by RSTACK_HOOKS' : 'not a Git repository';
console.log(`Git hooks setup skipped: ${reason}.`);
logger.info(`Git hooks setup skipped: ${color.yellow(reason)}.`);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/rstack/tests/cli/setup/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ test('installs a custom hooks directory from a nested project', ({ execCli, expe

test('skips non-Git directories without creating files', ({ execCli, expect }) => {
expect(execCli('setup', { cwd, env })).toContain(
'Git hooks setup skipped: not a Git repository.',
'info Git hooks setup skipped: not a Git repository.',
);
expect(existsSync(path.join(cwd, '.rstack'))).toBe(false);
});

test('skips setup when hooks are disabled', ({ execCli, expect }) => {
const output = execCli('setup', { cwd, env: { ...env, RSTACK_HOOKS: '0' } });

expect(output).toContain('Git hooks setup skipped: disabled by RSTACK_HOOKS.');
expect(output).toContain('info Git hooks setup skipped: disabled by RSTACK_HOOKS.');
expect(existsSync(path.join(cwd, '.rstack'))).toBe(false);
});

Expand Down