Skip to content

Commit d24db32

Browse files
clydinhansl
authored andcommitted
fix(@angular/cli): relax compatible angular check package location
1 parent 2397920 commit d24db32

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

packages/angular/cli/upgrade/version.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ export class Version {
4141
let angularPkgJson;
4242
let rxjsPkgJson;
4343

44-
const isInside = (base: string, potential: string): boolean => {
45-
const absoluteBase = path.resolve(base);
46-
const absolutePotential = path.resolve(potential);
47-
const relativePotential = path.relative(absoluteBase, absolutePotential);
48-
if (!relativePotential.startsWith('..') && !path.isAbsolute(relativePotential)) {
49-
return true;
50-
}
51-
52-
return false;
53-
};
54-
5544
try {
5645
const resolveOptions = {
5746
basedir: projectRoot,
@@ -61,11 +50,6 @@ export class Version {
6150
const angularPackagePath = resolve('@angular/core/package.json', resolveOptions);
6251
const rxjsPackagePath = resolve('rxjs/package.json', resolveOptions);
6352

64-
if (!isInside(projectRoot, angularPackagePath)
65-
|| !isInside(projectRoot, rxjsPackagePath)) {
66-
throw new Error();
67-
}
68-
6953
angularPkgJson = require(angularPackagePath);
7054
rxjsPkgJson = require(rxjsPackagePath);
7155
} catch {

0 commit comments

Comments
 (0)