FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(@angular/cli): ng get: return whole config root when no path provided. by prestonvanloon · Pull Request #5887 · angular/angular-cli · GitHub

fix(@angular/cli): ng get: return whole config root when no path provided. - #5887

Closed
prestonvanloon wants to merge 8 commits into
angular:masterfrom
prestonvanloon:fix/ng-get
Closed

prestonvanloon wants to merge 8 commits into
angular:masterfrom
prestonvanloon:fix/ng-get

Conversation

prestonvanloon commented Apr 8, 2017 •
edited
Loading

Copy link
Copy Markdown
Contributor

Running ng get without a config key would throw a invalidJsonPath error rather than a meaningful message.

This PR

  • returns the whole config object when no json path provided.
  • pretty prints the object using JSON.stringify(value, null, 2).

Fixes #5886

Comment thread packages/@angular/cli/commands/get.ts Outdated
const GetCommand = Command.extend({
name: 'get',
description: 'Get a value from the configuration.',
description: 'Get a value from the configuration. Example: ng get project.name',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@prestonvanloon Please change this to match format eg. "ng new [name]".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done.

Comment thread tests/e2e/tests/commands/get/get.ts Outdated
export default function() {
return Promise.resolve()
.then(() => expectToFail(() => ng('get', 'apps.zzz.prefix')))
.then(() => expectToFail(() => ng('get', undefined)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should be just ng('get') as ng get undefined seems to be working fine already as it is converted to string key.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done.

Copy link
Copy Markdown
Contributor Author

I think this should be closed in favor of returning the whole config object when no param specified.

I'll submit a new PR later.

Copy link
Copy Markdown
Contributor Author

Or this PR modified to return the whole object. Not sure what is preferred.

prestonvanloon changed the title fix(@angular/cli): Throw error when no key provided for ng get fix(@angular/cli): ng get: return whole config root when no path provided. Apr 9, 2017

Copy link
Copy Markdown
Contributor Author

I updated this PR title, description, and content with the changes outlined in my previous comment.

Copy link
Copy Markdown
Contributor

Heya @prestonvanloon thanks for the work here. Can you rebase this PR? There's a couple of CI errors that were due to changes on our side, but it should be fine now.

Copy link
Copy Markdown
Contributor Author

@filipesilva OK. Should be all good now. Thanks!

hansl closed this in 382ba8d May 9, 2017
filipesilva pushed a commit to filipesilva/angular-cli that referenced this pull request May 9, 2017
filipesilva pushed a commit to filipesilva/angular-cli that referenced this pull request May 9, 2017
prestonvanloon deleted the fix/ng-get branch May 11, 2017 02:56
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this pull request Apr 23, 2018
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this pull request Apr 23, 2018

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2019
mostafaibr pushed a commit to mostafaibr/angular-cli that referenced this pull request May 29, 2026
mostafaibr pushed a commit to mostafaibr/angular-cli that referenced this pull request May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng get causes InvalidJsonPath error

4 participants


Back | FazBrowse Home | New Git URL