(skipConfirmation: boolean = false)
| 225 | } |
| 226 | |
| 227 | public async updatePackages(skipConfirmation: boolean = false): Promise<boolean> { |
| 228 | const rPath = this.rHelp.rPath; |
| 229 | const cranUrl = await getCranUrl('', this.cwd); |
| 230 | const args = ['--silent', '--no-echo', '--no-save', '--no-restore', '-e', `update.packages(ask=FALSE,repos='${cranUrl}')`]; |
| 231 | const cmd = `${rPath} ${args.join(' ')}`; |
| 232 | const confirmation = 'Yes, update all packages!'; |
| 233 | const prompt = 'Are you sure you want to update all installed packages? This might take some time!'; |
| 234 | |
| 235 | if(skipConfirmation || await getConfirmation(prompt, confirmation, cmd)){ |
| 236 | await executeAsTask('Update Packages', rPath, args, true); |
| 237 | return true; |
| 238 | } else{ |
| 239 | return false; |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | public async getPackages(fromCran: boolean = false): Promise<Package[]|undefined> { |
| 244 | let packages: Package[]|undefined; |
no test coverage detected