MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / updatePackages

Method updatePackages

src/helpViewer/packages.ts:227–241  ·  view source on GitHub ↗
(skipConfirmation: boolean = false)

Source from the content-addressed store, hash-verified

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;

Callers 1

_handleCommandMethod · 0.80

Calls 3

getCranUrlFunction · 0.90
getConfirmationFunction · 0.90
executeAsTaskFunction · 0.90

Tested by

no test coverage detected