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

Commit

Permalink
Merge pull request #374 from prabushi/master
Browse files Browse the repository at this point in the history
Plugin improvements
  • Loading branch information
prabushi committed Apr 22, 2021
2 parents 41c49cc + 6c1c84a commit 86505d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,6 @@
"webpack-cli": "^3.3.3"
},
"extensionPack": [
"bungcip.better-toml"
"be5invis.toml"
]
}
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 86505d4

Please sign in to comment.