MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / getRPackageVersion

Function getRPackageVersion

src/util.ts:335–338  ·  view source on GitHub ↗
(name: string, cwd?: string | URL)

Source from the content-addressed store, hash-verified

333}
334
335export async function getRPackageVersion(name: string, cwd?: string | URL): Promise<string | undefined> {
336 const result = await executeRCommand(`cat(if (requireNamespace('${name}', quietly = TRUE)) as.character(utils::packageVersion('${name}')) else '')`, cwd);
337 return result || undefined;
338}
339
340export function compareVersions(v1: string, v2: string): number {
341 const parts1 = v1.split('.').map(Number);

Callers

nothing calls this directly

Calls 1

executeRCommandFunction · 0.85

Tested by

no test coverage detected