-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ng): add warning when angular-cli is detected locally #4466
Conversation
packages/@angular/cli/bin/ng
Outdated
@@ -86,6 +86,34 @@ if (require('../package.json')['name'] == 'angular-cli' | |||
`)); | |||
} | |||
|
|||
const packageJsonProject = require(path.join(process.cwd(), 'package.json')); | |||
const hasOldDep = Boolean(packageJsonProject.dependencies['angular-cli']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!
is preferred.
LGTM outside of the nit above. |
cb739db
to
58c3559
Compare
Nit addressed |
58c3559
to
b831158
Compare
WIP: Please don't merge yet. I just found out that this causes an error when running it outside of a project:
I will add a check for this. |
b831158
to
f497345
Compare
f497345
to
1f87128
Compare
Issues should be fixed, @hansl can you please re-review? |
@@ -86,6 +86,30 @@ if (require('../package.json')['name'] == 'angular-cli' | |||
`)); | |||
} | |||
|
|||
const packageJsonProjectPath = path.join(process.cwd(), 'package.json') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We allow people to run anywhere inside a project. You should use the __dirname
instead (and potentially findup
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure this works inside any dir in a project.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.