Skip to content
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

multiple and wrong gitignore entry #2

Open
eturella opened this issue Feb 25, 2021 · 1 comment · May be fixed by #3
Open

multiple and wrong gitignore entry #2

eturella opened this issue Feb 25, 2021 · 1 comment · May be fixed by #3
Assignees

Comments

@eturella
Copy link

thanks for your work!

1

multiple call to "ng add" results in same number of gitignore entries
const buffer = host.read('.gitignore');
const content = buffer.toString();
if( !buffer.toString().includes('environments/version.ts'){
// call addEntry
}

2

and file isn't really ignore
sol1) environments/version.ts --> */environments/version.ts
sol2) create a .gitignore in the same path of version.js

@kaihenzler kaihenzler self-assigned this Feb 25, 2021
eturella added a commit to eturella/angular-git-info that referenced this issue Feb 25, 2021
@eturella eturella linked a pull request Feb 25, 2021 that will close this issue
@kaihenzler
Copy link
Member

I see why the gitignore doesn't seem to work in some cases but you shouldn't be able to to run ng add multiple times.

If I run it again after it's already been added to the project I get the following error:

$ ng add @w11k/git-info
Skipping installation: Package already installed
ERROR! git-version.js already exists.
The Schematic workflow failed. See above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants