JPeer264 / node-semantic-git-commit-cli

A CLI for semantic git commits
https://www.npmjs.com/package/semantic-git-commit-cli
MIT License
147 stars 11 forks source link

Option for alternative config path #60

Closed Joaquin6 closed 4 years ago

Joaquin6 commented 6 years ago

Right now, the only locations to provide configuration is at path.join(cwd, '.sgcrc'), path.join(homedir, '.sgcrc') (user's machine home directory), or inside package.json in a sgc property. According to the getConfig method, we should be able to pass in a alternative path. However it doesn't seem to be used at all when called from the cli module.

It be nice to be able to be able to pass in the alternative path so the end user can choose where to place their config file.

aichbauer commented 6 years ago

I think that is a good idea. What do you think @JPeer264

JPeer264 commented 6 years ago

Do you have a specific use case for this where you see an advantage of this feature, or a way how this could look like?

The only two ways of what I can think of is either:

  1. Applying the path at each call of sgc e.g.: sgc --config-path=/path/(which, imho, might be annoying over some time)
  2. Setting a (global or project wide) sgcs default, kinda like git (which does not exist atm) e.g.: sgc set config-path "/path/" or sgc set --global config-path "/path/"

But yeah, you are right. This parameter is not yet used. If there is a reasonable use case and a clean implementation I would consider to implement this feature.

JPeer264 commented 6 years ago

@Joaquin6 ping

JPeer264 commented 4 years ago

Closed due to no response. If somebody needs this feature just comment and I'll reopen this issue.