Skip to content

Commit

Permalink
Merge pull request #7 from andreaTP/dedup-output
Browse files Browse the repository at this point in the history
Don't print to std-out twice
  • Loading branch information
EricWittmann authored Nov 6, 2023
2 parents 26ba6a0 + 4ffdec8 commit 64accb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kiota-gen-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions kiota-gen/bin/kiota.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ const kiota = async (kiotaVersion, args) => {
return new Promise((resolve, reject) => {
shell.exec(kiotaCmdWithArgs, (code, stdout, stderr) => {
if (code > 0) {
console.error(stderr);
reject(new Error("Kiota failed."));
} else {
console.log(stdout);
console.log("---------------------------------------------");
console.log("Kiota code generation completed successfully.");
console.log("---------------------------------------------");
Expand All @@ -212,7 +210,7 @@ const main = async (...args) => {
if (kiotaVersion === undefined || kiotaVersion === "" || kiotaVersion === "latest") {
kiotaVersion = await getLatestKiotaReleaseVersion();
}
return kiota(kiotaVersion, args);
return await kiota(kiotaVersion, args);
};

// Extract the args from the process and invoke the main function.
Expand Down

0 comments on commit 64accb6

Please sign in to comment.