Skip to content
Merged
Changes from 1 commit
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
Next Next commit
print example command
  • Loading branch information
cperaltah committed Oct 18, 2024
commit c9b4a7d96122a3d67f6c223f32909aaf471c1747
10 changes: 10 additions & 0 deletions tools/tsp-client/src/typespec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ export async function compileTsp({
overrides,
});
Logger.debug(`Compiler options: ${JSON.stringify(options)}`);

const cliOptions = Object.entries(options.options?.[emitterPackage] ?? {})
.map(([key, value]) => `--option ${key}=${value}`)
.join(" ");

const exampleCmd = `npx tsp compile ${resolvedMainFilePath} --emit ${emitterPackage} ${cliOptions}`;
Logger.warn(`Example of how to compile using the tsp commandline. tsp-client does NOT directly run this command, results may vary:
${exampleCmd}
`);

if (diagnostics.length > 0) {
let errorDiagnostic = false;
// This should not happen, but if it does, we should log it.
Expand Down