Skip to content

Commit

Permalink
update:add .gox file error output
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Apr 11, 2024
1 parent 4529572 commit 6310431
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/pathUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export function getToolFromToolPath(toolPath: string): string | undefined {
export function expandFilePathInOutput(output: string, cwd: string): string {
const lines = output.split('\n');
for (let i = 0; i < lines.length; i++) {
const matches = lines[i].match(/\s*(\S+\.(go|gop)):(\d+):/);
const matches = lines[i].match(/\s*(\S+\.(go|gop|gox)):(\d+):/);
if (matches && matches[1] && !path.isAbsolute(matches[1])) {
lines[i] = lines[i].replace(matches[1], path.join(cwd, matches[1]));
}
Expand All @@ -288,7 +288,7 @@ export function expandFilePathInOutput(output: string, cwd: string): string {
export function expandFilePathInErrorOutput(output: string, cwd: string, isGop: boolean, modPath: string): string {
const lines = output.split('\n');
for (let i = 0; i < lines.length; i++) {
const matches = lines[i].match(/\s*(\S+\.(go|gop)):(\d+):/);
const matches = lines[i].match(/\s*(\S+\.(go|gop|gox)):(\d+):/);
if (matches && matches[1]) {
const file = matches[1];
const fileExt = path.extname(file);
Expand All @@ -305,7 +305,7 @@ export function expandFilePathInErrorOutput(output: string, cwd: string, isGop:
outputDir = modPath;
}
absoluteFilePath = path.join(outputDir, file);
} else if (fileExt === '.gop') absoluteFilePath = path.join(modPath, file);
} else if (['.gop', '.gox'].includes(fileExt)) absoluteFilePath = path.join(modPath, file);
}
lines[i] = lines[i].replace(file, absoluteFilePath);
}
Expand Down

0 comments on commit 6310431

Please sign in to comment.