-
Notifications
You must be signed in to change notification settings - Fork 12k
ng completion -b >> ~/.bashrc fails if local cli version is different from global cli version #6343
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
Comments
This is not a bug, and here's why. Typically, running If you use oh-my-zsh or bash-it, and enable ng tool support, the completion for ng is switched on transparently, as soon as the shell is started and gives control back to the user. You do not need to run this command constantly, unless you develop the completion functionality in angular/cli. In fact, |
I consider it a bug (if it is supposed to fail) as:
From my point on view, it shouldn't cause an error. As different versions can be used, For exemple, outside project, the global version will be used (and so default bash completion may apply). But when on a specific project, you must still have capacity to execute |
The user who wants to generate NG completion inside of an ng app folder has to face the consequences. PR #7246 corrects the behaviour, whereby the warning on version mismatch is written as a shell comment to stdout. This almost satisfies your first concern. The problem is that both I disagree with your second point. The third point would be a small change. |
I will speak from my personal experience. For a CLI tool, completion is not a nice-to-have but must-to-have. Having different versions of CLI isn't an exceptional case to me. You're working on different project and CLI is installed globally (to be able to use
Interfaces for machine can't act as those for humans. In Web development, they are some practise to use |
… does not produce output If an ng app was created with an older version of ng CLI, while the global ng CLI is more recent, one cannot perform ng completion INSIDE that app folder. This is due to the warning being written to stdout, which if appended to ~/.bashrc causes the shell to fail to process the English text as commands. The solution is to display the warning to stderr without producing the completion output. In good Unix style, a non-zero status code must returned. This PR fixes angular#6343. The PR introduces a breaking change: - the warning is written to stderr - - no output is produced - different status code returned
… does not produce output If an ng app was created with an older version of ng CLI, while the global ng CLI is more recent, one cannot perform ng completion INSIDE that app folder. This is due to the warning being written to stdout, which if appended to ~/.bashrc causes the shell to fail to process the English text as commands. The solution is to display the warning to stderr without producing the completion output. In good Unix style, a non-zero status code must returned. This PR fixes #6343. The PR introduces a breaking change: - the warning is written to stderr - - no output is produced - different status code returned
… does not produce output If an ng app was created with an older version of ng CLI, while the global ng CLI is more recent, one cannot perform ng completion INSIDE that app folder. This is due to the warning being written to stdout, which if appended to ~/.bashrc causes the shell to fail to process the English text as commands. The solution is to display the warning to stderr without producing the completion output. In good Unix style, a non-zero status code must returned. This PR fixes #6343. The PR introduces a breaking change: - the warning is written to stderr - - no output is produced - different status code returned
… does not produce output If an ng app was created with an older version of ng CLI, while the global ng CLI is more recent, one cannot perform ng completion INSIDE that app folder. This is due to the warning being written to stdout, which if appended to ~/.bashrc causes the shell to fail to process the English text as commands. The solution is to display the warning to stderr without producing the completion output. In good Unix style, a non-zero status code must returned. This PR fixes angular#6343. The PR introduces a breaking change: - the warning is written to stderr - - no output is produced - different status code returned
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. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
ng completion -b >> ~/.bashrc
At this point .bashrc includes the warning message
Your global Angular CLI version (1.0.1) is greater than your local
The log given by the failure.
Opening a new bash shell prints out
The text was updated successfully, but these errors were encountered: