Skip to content

Commit 510d22b

Browse files
authored
feat(setup): improve skipped setup log (#154)
1 parent ebad66c commit 510d22b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/rstack/src/setup/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { parseArgs } from 'node:util';
2-
import { color } from 'rslog';
2+
import { color, logger } from 'rslog';
33
import { installHooks } from './install.ts';
44

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

packages/rstack/tests/cli/setup/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ test('installs a custom hooks directory from a nested project', ({ execCli, expe
108108

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

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

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

0 commit comments

Comments
 (0)