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

Loading a config file only works with relative paths πŸ€·β€β™‚οΈ #13

Open
joshuatvernon opened this issue Mar 15, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@joshuatvernon
Copy link

Loading a config file only works with relative paths πŸ€·β€β™‚οΈ

Examples

  1. ~ expansion e.g.

    $ commitpal -c ~/.commitpal.config.json -n
    Error: /Users/jvernon/.commitpal.config.json not found
    
    ? Please choose a preset …
    Angular commit format
    Emoji
    Jira ticket
  2. Absolute paths e.g.

    $ commitpal -c /Users/jvernon/.commitpal.config.json -n
    Error: /Users/jvernon/.commitpal.config.json not found
    
    ? Please choose a preset …
    Angular commit format
    Emoji
    Jira ticket
  3. Relative paths e.g.

    commitpal -c ./.commitpal.config.json -n
    ? What type of change? …
    feature
    bugfix
    documentation
    style
    tests
    chore
@joshuatvernon
Copy link
Author

joshuatvernon commented Mar 15, 2021

This is my current workaround πŸ˜‹

function gcp() {
  if ! command -v commitpal &> /dev/null
  then
      npm install commitpal -g
  fi
  local config_path
  config_path=$(realpath --relative-to=. ~/.commitpal.config.json)
  commitpal -c "$config_path" -n
}

Then I can just run this from anywhere

$ gcp

@danieldelcore
Copy link
Owner

Hey @joshuatvernon, thanks for raising this issue!

I'm pretty sure if the config file is not specified, commitpal will attempt to climb the file tree to find one! You could try omitting the config flag to see if it picks up the file in the meantime.

I'll have to look into fixing the issues with the flag, that's definitely a big problem (would love a PR if you're up to it πŸ˜„)

@danieldelcore danieldelcore added the bug Something isn't working label Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants