Skip to content

Commit

Permalink
fix(@angular/cli): relax compatible angular check package location
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and hansl committed Sep 26, 2018
1 parent 2397920 commit d24db32
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions packages/angular/cli/upgrade/version.ts
Expand Up @@ -41,17 +41,6 @@ export class Version {
let angularPkgJson;
let rxjsPkgJson;

const isInside = (base: string, potential: string): boolean => {
const absoluteBase = path.resolve(base);
const absolutePotential = path.resolve(potential);
const relativePotential = path.relative(absoluteBase, absolutePotential);
if (!relativePotential.startsWith('..') && !path.isAbsolute(relativePotential)) {
return true;
}

return false;
};

try {
const resolveOptions = {
basedir: projectRoot,
Expand All @@ -61,11 +50,6 @@ export class Version {
const angularPackagePath = resolve('@angular/core/package.json', resolveOptions);
const rxjsPackagePath = resolve('rxjs/package.json', resolveOptions);

if (!isInside(projectRoot, angularPackagePath)
|| !isInside(projectRoot, rxjsPackagePath)) {
throw new Error();
}

angularPkgJson = require(angularPackagePath);
rxjsPkgJson = require(rxjsPackagePath);
} catch {
Expand Down

0 comments on commit d24db32

Please sign in to comment.