Skip to content

Commit

Permalink
Only check for 2019 updates when checking for WPILib updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Oct 19, 2019
1 parent 584c746 commit 1dec578
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions vscode-wpilib/src/unittest/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const data = [
new TestData('2019.1.1-beta-3', '2019.1.1-beta-3-pre5', true),
new TestData('2019.1.1-beta-3-pre7', '2019.1.1-beta-3-pre6', true),
new TestData('2019.1.1-beta-3a', '2019.1.1-beta-3-pre1', true),
new TestData('2019.4.1', '0', true),
];

suite('Version Tests', () => {
Expand Down
7 changes: 4 additions & 3 deletions vscode-wpilib/src/wpilibupdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class WPILibUpdates {
return false;
} else {
const result = await vscode.window.showInformationMessage
(`WPILib project update (${newVersion}) found, would you like to install it? ` +
(`WPILib project update (${newVersion.newVersion}) found, would you like to install it? ` +
`${grVersion} currently installed`, {
modal: true,
}, 'Yes', 'No');
Expand Down Expand Up @@ -177,9 +177,10 @@ export class WPILibUpdates {
if (versions.length === 0) {
return undefined;
}
let newestVersion = versions[0];
let newestVersion = '0';
const frcYear = this.externalApi.getUtilitiesAPI().getFrcYear();
for (const v of versions) {
if (isNewerVersion(v, newestVersion)) {
if (v.startsWith(frcYear) && isNewerVersion(v, newestVersion)) {
newestVersion = v;
}
}
Expand Down

0 comments on commit 1dec578

Please sign in to comment.