Skip to content

Commit

Permalink
Merge pull request #1322 from posit-dev/feature/skip-broken-r-install…
Browse files Browse the repository at this point in the history
…ation

Exit early if no DESCRIPTION found for utils package
  • Loading branch information
jmcphers authored Sep 15, 2023
2 parents bfae34a + 2472c88 commit b107652
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extensions/positron-r/src/r-installation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import * as semver from 'semver';
import * as path from 'path';
import * as fs from 'fs';
import { extractValue, readLines } from './util';

/**
Expand Down Expand Up @@ -63,6 +64,11 @@ export class RInstallation {
// make sure to target a base package that contains compiled code, so the
// 'Built' field contains the platform info
const descPath = path.join(this.homepath, 'library', 'utils', 'DESCRIPTION');
// We have actually seen an R "installation" that doesn't have the base packages!
// https://github.com/posit-dev/positron/issues/1314
if (!fs.existsSync(descPath)) {
return;
}
const descLines = readLines(descPath);
const targetLine2 = descLines.filter(line => line.match('Built'))[0];
if (!targetLine2) {
Expand Down

0 comments on commit b107652

Please sign in to comment.