Skip to content

Commit

Permalink
JS: silent logging when dumping to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Nov 11, 2024
1 parent 8ba1e31 commit 0072f69
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions javascript_client/src/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function sync(options: SyncOptions) {
var verbose = !!options.verbose
var url = options.url
var dumpingPayload = "dumpPayload" in options
var dumpingToStdout = options.dumpPayload == true
if (!url && !dumpingPayload) {
logger.log("No URL; Generating artifacts without syncing them")
}
Expand Down Expand Up @@ -241,12 +242,18 @@ function sync(options: SyncOptions) {
operations: payload.operations,
generatedCode,
}
logger.log("Generating client module in " + logger.colorize("bright", outfile) + "...")
if (!dumpingToStdout) {
logger.log("Generating client module in " + logger.colorize("bright", outfile) + "...")
}
fs.writeFileSync(outfile, generatedCode, "utf8")
logger.log(logger.green("✓ Done!"))
if (!dumpingToStdout) {
logger.log(logger.green("✓ Done!"))
}
return finishedPayload
} else {
logger.log(logger.green("✓ Done!"))
if (!dumpingToStdout) {
logger.log(logger.green("✓ Done!"))
}
return payload
}
})
Expand Down

0 comments on commit 0072f69

Please sign in to comment.