Skip to content

Commit

Permalink
Fix vendor online and local libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Oct 19, 2018
1 parent 11991bd commit 9619861
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions vscode-wpilib/src/vendorlibraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,37 +218,33 @@ export class VendorLibraries {
private async offlineNew(workspace: vscode.WorkspaceFolder): Promise<void> {
const installedDeps = await this.getInstalledDependencies(workspace);

if (installedDeps.length !== 0) {
const availableDeps = await this.getHomeDirDeps();
const updatableDeps = [];
for (const ad of availableDeps) {
let foundDep = false;
for (const id of installedDeps) {
if (id.uuid === ad.uuid) {
foundDep = true;
continue;
}
}
if (!foundDep) {
updatableDeps.push(new LibraryQuickPick(ad));
const availableDeps = await this.getHomeDirDeps();
const updatableDeps = [];
for (const ad of availableDeps) {
let foundDep = false;
for (const id of installedDeps) {
if (id.uuid === ad.uuid) {
foundDep = true;
continue;
}
}
if (updatableDeps.length !== 0) {
const toInstall = await vscode.window.showQuickPick(updatableDeps, {
canPickMany: true,
placeHolder: 'Check to install',
});
if (!foundDep) {
updatableDeps.push(new LibraryQuickPick(ad));
}
}
if (updatableDeps.length !== 0) {
const toInstall = await vscode.window.showQuickPick(updatableDeps, {
canPickMany: true,
placeHolder: 'Check to install',
});

if (toInstall !== undefined) {
for (const ti of toInstall) {
await this.installDependency(ti.dep, this.getWpVendorFolder(workspace), true);
}
if (toInstall !== undefined) {
for (const ti of toInstall) {
await this.installDependency(ti.dep, this.getWpVendorFolder(workspace), true);
}
} else {
await vscode.window.showInformationMessage('No new dependencies available');
}
} else {
await vscode.window.showInformationMessage('No dependencies installed');
await vscode.window.showInformationMessage('No new dependencies available');
}
}

Expand Down

0 comments on commit 9619861

Please sign in to comment.