Skip to content

Commit aff02fe

Browse files
authored
fix: default path resolution (#92)
couple of things are broken here, - we never checked common locations because the default apamaHome value went from null to "", and we removed the undefined check anyway. - our find in path check is broken on 26.x because our executables are at /usr/bin.
1 parent 408328a commit aff02fe

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v2.1.1
2+
* Fixed a bug where the default install location for Apama was never searched.
3+
14
## v2.1.0
25
* Added new Command Palette option `Create in Project New Folder` for easily creating a new project directory.
36
* Added support for automatically reloading the extension when the "Apama Home" configuration option is changed.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "apama-extensions",
44
"displayName": "apama-extensions",
55
"description": "Support for writing Apama Streaming Analytics applications in EPL",
6-
"version": "2.1.0",
6+
"version": "2.1.1",
77
"license": "Apache-2.0",
88
"repository": {
99
"type": "git",

src/extension.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,15 @@ export async function determineIfApamaExists(): Promise<false | string> {
108108

109109
// See if we can find a correlator.
110110
const correlatorResolver = new ExecutableResolver("correlator", logger);
111+
let correlatorResolve;
112+
113+
if (userApamaHome != undefined && userApamaHome != "") {
114+
// If the user has specified an Apama Home, we only use that.
115+
correlatorResolve = await correlatorResolver.resolve(path.join(userApamaHome as string, "bin"));
116+
} else {
117+
correlatorResolve = await correlatorResolver.resolve();
118+
}
111119

112-
// If the user has specified an Apama Home, we only use that.
113-
const correlatorResolve = await correlatorResolver.resolve(
114-
path.join(userApamaHome as string, "bin"),
115-
);
116120

117121
if (correlatorResolve.isOk()) {
118122
logger.debug(`Found the correlator at ${correlatorResolve.value}`);

src/settings/ExecutableResolver.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ export class ExecutableResolver {
3737
);
3838
}
3939

40-
const pathResolved = await this.findInPath();
41-
if (pathResolved.isOk()) {
42-
return pathResolved; // Return the Result directly, don't wrap it in another ok()
43-
}
44-
4540
return await this.findInCommonLocations();
4641
}
4742

0 commit comments

Comments
 (0)