Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Reduce unused warn logs
Browse files Browse the repository at this point in the history
  • Loading branch information
prabushi committed Apr 22, 2021
1 parent e97417a commit 07dded2
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/core/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ export class BallerinaExtension {
async getBallerinaVersion(ballerinaHome: string, overrideBallerinaHome: boolean): Promise<string> {
// if ballerina home is overridden, use ballerina cmd inside distribution
// otherwise use wrapper command
debug(`Ballerina Home: ${ballerinaHome}`);
if (ballerinaHome) {
debug(`Ballerina Home: ${ballerinaHome}`);
}
let distPath = "";
if (overrideBallerinaHome) {
distPath = path.join(ballerinaHome, "bin") + path.sep;
Expand All @@ -260,9 +262,13 @@ export class BallerinaExtension {

let ballerinaExecutor = '';
const balPromise: Promise<string> = new Promise((resolve, reject) => {
exec(distPath + 'bal' + exeExtension + ' version', (err, stdout, _stderr) => {
debug(`bal command stdout: ${stdout}`);
debug(`bal command _stderr: ${_stderr}`);
exec(distPath + 'bal' + exeExtension + ' version', (err, stdout, stderr) => {
if (stdout) {
debug(`bal command stdout: ${stdout}`);
}
if (stderr) {
debug(`bal command _stderr: ${stderr}`);
}
if (err) {
debug(`bal command err: ${err}`);
reject(err);
Expand All @@ -280,9 +286,13 @@ export class BallerinaExtension {
});
});
const ballerinaPromise: Promise<string> = new Promise((resolve, reject) => {
exec(distPath + 'ballerina' + exeExtension + ' version', (err, stdout, _stderr) => {
debug(`ballerina command stdout: ${stdout}`);
debug(`ballerina command _stderr: ${_stderr}`);
exec(distPath + 'ballerina' + exeExtension + ' version', (err, stdout, stderr) => {
if (stdout) {
debug(`ballerina command stdout: ${stdout}`);
}
if (stderr) {
debug(`ballerina command _stderr: ${stderr}`);
}
if (err) {
debug(`ballerina command err: ${err}`);
reject(err);
Expand Down

0 comments on commit 07dded2

Please sign in to comment.