(pickMany: boolean = false)
| 175 | |
| 176 | // let the user pick and install a package from CRAN |
| 177 | public async pickAndInstallPackages(pickMany: boolean = false): Promise<boolean> { |
| 178 | const packages = await doWithProgress(() => this.getPackages(true), this.rHelp.treeViewWrapper.viewId); |
| 179 | if(!packages?.length){ |
| 180 | return false; |
| 181 | } |
| 182 | const pkgs = await pickPackages(packages, 'Please select a package.', pickMany); |
| 183 | if(pkgs?.length){ |
| 184 | const pkgsConfirmed = await confirmPackages('Are you sure you want to install these packages?', pkgs); |
| 185 | if(pkgsConfirmed?.length){ |
| 186 | const names = pkgsConfirmed.map(v => v.name); |
| 187 | return await this.installPackages(names, true); |
| 188 | } |
| 189 | } |
| 190 | return false; |
| 191 | } |
| 192 | |
| 193 | // remove a specified package. The packagename is selected e.g. in the help tree-view |
| 194 | public async removePackage(pkgName: string): Promise<boolean> { |
no test coverage detected