File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/@angular/cli/utilities Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,10 @@ import * as fs from 'fs';
2
2
import * as os from 'os' ;
3
3
import * as path from 'path' ;
4
4
import { findUp } from './find-up' ;
5
+ import { normalize } from '@angular-devkit/core' ;
5
6
6
7
export function insideProject ( ) : boolean {
7
- const possibleConfigFiles = [ 'angular.json' , '.angular.json' ] ;
8
-
9
- return findUp ( possibleConfigFiles , process . cwd ( ) ) !== null ;
8
+ return getProjectDetails ( ) !== null ;
10
9
}
11
10
12
11
export interface ProjectDetails {
@@ -31,7 +30,7 @@ export function getProjectDetails(): ProjectDetails | null {
31
30
const possibleDir = path . dirname ( configFilePath ) ;
32
31
33
32
const homedir = os . homedir ( ) ;
34
- if ( possibleDir === homedir ) {
33
+ if ( normalize ( possibleDir ) === normalize ( homedir ) ) {
35
34
const packageJsonPath = path . join ( possibleDir , 'package.json' ) ;
36
35
if ( ! fs . existsSync ( packageJsonPath ) ) {
37
36
// No package.json
You can’t perform that action at this time.
0 commit comments