Skip to content

fix(config): SetEnv appends to gitignore every time

Created by: andhe

Description This change fixes so that my .gitignore doesn't grow an additional ".glab-cli" line every time I run the command (which thus far has been only to test ./bin/glab config --global).

How Has This Been Tested? I've run rm -rf ~/.config/glab-cli ; ./bin/glab config --global under the following circumstances and observed the behaviour:

  • Default .gitignore already containing .glab-cli -> without fix: .glab-cli appended to .gitignore twice(!) -> with fix: no change of .gitignore file
  • Both(!) occurances of .glab-cli removed from .gitignore -> without fix: .glab-cli appended to .gitignore twice(!) -> with fix: .glab-cli appended to .gitignore
  • With .gitignore file removed -> without fix: .gitignore created and .glab-cli appended to .gitignore twice(!) -> with fix: .gitignore created and .glab-cli appended to .gitignore

Note: testing was done before the second commit, obviously using --global flag for test would not be useful.

Merge request reports