Skip to content

Commit 3a57b79

Browse files
committed
fix(@angular/cli): Update in project logic
fixes #10594
1 parent b509d61 commit 3a57b79

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/@angular/cli/utilities/project.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import * as fs from 'fs';
22
import * as os from 'os';
33
import * as path from 'path';
44
import { findUp } from './find-up';
5+
import { normalize } from '@angular-devkit/core';
56

67
export function insideProject(): boolean {
7-
const possibleConfigFiles = ['angular.json', '.angular.json'];
8-
9-
return findUp(possibleConfigFiles, process.cwd()) !== null;
8+
return getProjectDetails() !== null;
109
}
1110

1211
export interface ProjectDetails {
@@ -31,7 +30,7 @@ export function getProjectDetails(): ProjectDetails | null {
3130
const possibleDir = path.dirname(configFilePath);
3231

3332
const homedir = os.homedir();
34-
if (possibleDir === homedir) {
33+
if (normalize(possibleDir) === normalize(homedir)) {
3534
const packageJsonPath = path.join(possibleDir, 'package.json');
3635
if (!fs.existsSync(packageJsonPath)) {
3736
// No package.json

0 commit comments

Comments
 (0)