Skip to content

Commit 7d8efa6

Browse files
committed
Change how component version is checked
Signed-off-by: worksofliam <[email protected]>
1 parent eb9ea6e commit 7d8efa6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/connection/syntaxChecker/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,18 @@ export class SQLStatementChecker implements IBMiComponent {
4242
private readonly functionName = VALIDATOR_NAME;
4343
private readonly currentVersion = 5;
4444

45-
private installedVersion = 1;
4645
private library = "";
4746

4847
static get(): SQLStatementChecker|undefined {
4948
return getInstance()?.getConnection()?.getComponent<SQLStatementChecker>(SQLStatementChecker.ID);
5049
}
5150

5251
reset() {
53-
this.installedVersion = 0;
5452
this.library = "";
5553
}
5654

5755
getIdentification(): ComponentIdentification {
58-
return { name: SQLStatementChecker.ID, version: this.installedVersion };
56+
return { name: SQLStatementChecker.ID, version: this.currentVersion };
5957
}
6058

6159
static async getVersionOf(connection: IBMi, schema: string, name: string) {
@@ -79,8 +77,8 @@ export class SQLStatementChecker implements IBMiComponent {
7977
return `NeedsUpdate`;
8078
}
8179

82-
this.installedVersion = await SQLStatementChecker.getVersionOf(connection, this.library, this.functionName);
83-
if (this.installedVersion < this.currentVersion) {
80+
const installedVersion = await SQLStatementChecker.getVersionOf(connection, this.library, this.functionName);
81+
if (installedVersion < this.currentVersion) {
8482
return `NeedsUpdate`;
8583
}
8684

0 commit comments

Comments
 (0)