Skip to content

Commit

Permalink
Fix in clang-format arg handling
Browse files Browse the repository at this point in the history
  • Loading branch information
OfekShilon committed Aug 22, 2024
1 parent 09fc2c1 commit d5e86c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tooling/clang-format-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export class ClangFormatTool extends BaseTool {
}

await fs.writeFile(path.join(dir, 'compile_flags.txt'), compileFlags.join('\n'));
const clang_format_file = path.join(dir, 'clang_format_options.txt');
await fs.writeFile(clang_format_file, stdin);
args.push(`-style=file:${clang_format_file}`);
if (stdin !== '') {
const clang_format_file = path.join(dir, 'clang_format_options.txt');
await fs.writeFile(clang_format_file, stdin);
args.push(`-style=file:${clang_format_file}`);
}
return await super.runTool(compilationInfo, sourcefile, args, stdin);
}
}

0 comments on commit d5e86c3

Please sign in to comment.