mirror of
https://github.com/yamadashy/repomix.git
synced 2026-02-03 11:33:39 +01:00
fix(cli): Show relative path for skill output when under cwd
When the skill directory is under the current working directory, show a relative path (e.g., .claude/skills/my-skill) instead of an absolute path for better readability.
This commit is contained in:
@@ -49,13 +49,18 @@ export const reportResults = (
|
||||
reportSkippedFiles(cwd, packResult.skippedFiles);
|
||||
logger.log('');
|
||||
|
||||
reportSummary(packResult, config, options);
|
||||
reportSummary(cwd, packResult, config, options);
|
||||
logger.log('');
|
||||
|
||||
reportCompletion();
|
||||
};
|
||||
|
||||
export const reportSummary = (packResult: PackResult, config: RepomixConfigMerged, options: ReportOptions = {}) => {
|
||||
export const reportSummary = (
|
||||
cwd: string,
|
||||
packResult: PackResult,
|
||||
config: RepomixConfigMerged,
|
||||
options: ReportOptions = {},
|
||||
) => {
|
||||
let securityCheckMessage = '';
|
||||
if (config.security.enableSecurityCheck) {
|
||||
if (packResult.suspiciousFilesResults.length > 0) {
|
||||
@@ -77,7 +82,9 @@ export const reportSummary = (packResult: PackResult, config: RepomixConfigMerge
|
||||
|
||||
// Show skill output path or regular output path
|
||||
if (config.skillGenerate !== undefined && options.skillDir) {
|
||||
logger.log(`${pc.white(' Output:')} ${pc.white(options.skillDir)} ${pc.dim('(skill directory)')}`);
|
||||
// Show relative path if under cwd, otherwise absolute path
|
||||
const displayPath = options.skillDir.startsWith(cwd) ? path.relative(cwd, options.skillDir) : options.skillDir;
|
||||
logger.log(`${pc.white(' Output:')} ${pc.white(displayPath)} ${pc.dim('(skill directory)')}`);
|
||||
} else {
|
||||
logger.log(`${pc.white(' Output:')} ${pc.white(config.output.filePath)}`);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('cliReport', () => {
|
||||
skippedFiles: [],
|
||||
};
|
||||
|
||||
reportSummary(packResult, config);
|
||||
reportSummary('/test/project', packResult, config);
|
||||
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('1 suspicious file(s) detected and excluded'));
|
||||
});
|
||||
@@ -76,7 +76,7 @@ describe('cliReport', () => {
|
||||
skippedFiles: [],
|
||||
};
|
||||
|
||||
reportSummary(packResult, config);
|
||||
reportSummary('/test/project', packResult, config);
|
||||
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('Git diffs included'));
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('50 tokens'));
|
||||
@@ -104,7 +104,7 @@ describe('cliReport', () => {
|
||||
skippedFiles: [],
|
||||
};
|
||||
|
||||
reportSummary(packResult, config);
|
||||
reportSummary('/test/project', packResult, config);
|
||||
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('No git diffs included'));
|
||||
});
|
||||
@@ -131,7 +131,7 @@ describe('cliReport', () => {
|
||||
skippedFiles: [],
|
||||
};
|
||||
|
||||
reportSummary(packResult, config);
|
||||
reportSummary('/test/project', packResult, config);
|
||||
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('Git logs included'));
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('30 tokens'));
|
||||
@@ -159,7 +159,7 @@ describe('cliReport', () => {
|
||||
skippedFiles: [],
|
||||
};
|
||||
|
||||
reportSummary(packResult, config);
|
||||
reportSummary('/test/project', packResult, config);
|
||||
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('No git logs included'));
|
||||
});
|
||||
@@ -185,7 +185,7 @@ describe('cliReport', () => {
|
||||
skippedFiles: [],
|
||||
};
|
||||
|
||||
reportSummary(packResult, config);
|
||||
reportSummary('/test/project', packResult, config);
|
||||
|
||||
expect(logger.log).toHaveBeenCalledWith(expect.stringContaining('Security check disabled'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user