Skip to content

ng completion -b >> ~/.bashrc fails if local cli version is different from global cli version #6343

Closed
@carlobonamico

Description

@carlobonamico

Bug Report or Feature Request (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Your global Angular CLI version (1.0.1) is greater than your local
version (1.0.0). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0
node: 6.10.3
os: linux x64
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/router: 4.0.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.2

Repro steps.

  1. create project with @angular/cli 1.0.0
  2. install @angular/cli 1.0.1 globally ( npm install -g @angular/cli)
  3. cd in the project folder
  4. run as suggested
    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

bash: /home/bonamico/.bashrc: line 115: syntax error near unexpected token `('
bash: /home/bonamico/.bashrc: line 115: `Your global Angular CLI version (1.0.1) is greater than your local'
`'`


### Desired functionality.
clarify help for ng completion so that the warning do not come up in the .bashrc file


### Mention any other details that might be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: investigationRequires some digging to determine if action is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions